Showing posts with label button. Show all posts
Showing posts with label button. Show all posts

Saturday, March 31, 2012

submitting a PDF form

I have a pdf form with form fields. I want to submit the values and post them to a database. I created a save button and the action is "Submit form". It calls an aspx file. When I try to write out the request variables I get none. For some reason none are getting posted. What am i doing wrong?
I have been trying to figure this out for quite some time and I am getting a bit frustrated, any help would be greatly appreciated.
Thanks.Code would be useful. What does the command look like that's attempting to write to the db? Is the information supplied to gain access to the db correct? Are the table/field names correct? Is your syntax correct?
The reason that I didnt bother posting any code is because I am getting stuck before the point that I try to put the info into the db. I cant even retrieve the form variables
Request.form("name of filed from pdf form")
this value gives me nothing.
My question is if there is something that I am supposed to be doing in the PDF form that should make this work.
thanks.
http://www.tgreer.com/pdfSubmit.html

Submitting the form correctly using the enter key

Hi all,

Simple problem:

I have a simple form and a submit and cancel image button underneath.

I also have a logout image button at the top of the page. This button is
rendered from a user control that is seperate from the form page itself.

At the moment if I press enter when inside a textbox the log out button is
activated. How can I make sure that the submit button is activated when the
user presses enter?

Many thanks all

Kind RegardsEnter activates the first submit button in the layout. See details at
http://www.allasp.net/enterkey.aspx

Can you place the logout button after the submit one?

Eliyahu

"thechaosengine" <sh856531@.microsofts_free_email_service.com> wrote in
message news:O5N%23amv9EHA.2996@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> Simple problem:
> I have a simple form and a submit and cancel image button underneath.
> I also have a logout image button at the top of the page. This button is
> rendered from a user control that is seperate from the form page itself.
> At the moment if I press enter when inside a textbox the log out button is
> activated. How can I make sure that the submit button is activated when
the
> user presses enter?
> Many thanks all
> Kind Regards
thechaosengine wrote:
> Hi all,
> Simple problem:
> I have a simple form and a submit and cancel image button underneath.
> I also have a logout image button at the top of the page. This button
> is rendered from a user control that is seperate from the form page
> itself.
> At the moment if I press enter when inside a textbox the log out
> button is activated. How can I make sure that the submit button is
> activated when the user presses enter?
> Many thanks all
> Kind Regards

You can capture the Enter key with JavaScript
to get the behavior you want:
http://dotnetjunkies.com/WebLog/dar...03/03/8374.aspx

--

Riki

Submitting the form correctly using the enter key

Hi all,
Simple problem:
I have a simple form and a submit and cancel image button underneath.
I also have a logout image button at the top of the page. This button is
rendered from a user control that is seperate from the form page itself.
At the moment if I press enter when inside a textbox the log out button is
activated. How can I make sure that the submit button is activated when the
user presses enter?
Many thanks all
Kind RegardsEnter activates the first submit button in the layout. See details at
http://www.allasp.net/enterkey.aspx
Can you place the logout button after the submit one?
Eliyahu
"thechaosengine" <sh856531@.microsofts_free_email_service.com> wrote in
message news:O5N%23amv9EHA.2996@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> Simple problem:
> I have a simple form and a submit and cancel image button underneath.
> I also have a logout image button at the top of the page. This button is
> rendered from a user control that is seperate from the form page itself.
> At the moment if I press enter when inside a textbox the log out button is
> activated. How can I make sure that the submit button is activated when
the
> user presses enter?
> Many thanks all
> Kind Regards
>
thechaosengine wrote:
> Hi all,
> Simple problem:
> I have a simple form and a submit and cancel image button underneath.
> I also have a logout image button at the top of the page. This button
> is rendered from a user control that is seperate from the form page
> itself.
> At the moment if I press enter when inside a textbox the log out
> button is activated. How can I make sure that the submit button is
> activated when the user presses enter?
> Many thanks all
> Kind Regards
You can capture the Enter key with JavaScript
to get the behavior you want:
http://dotnetjunkies.com/WebLog/dar...03/03/8374.aspx
Riki

Wednesday, March 28, 2012

suddenly a button does not respond anymore in IE - but still does in Firefox !

Why suddenly a button (on my login-page) does not respond anymore onIE, but still does in Firefox. I did not make any changes to the codeof that page!
Thank you for any information concering this problem!
Regards,
Fabian
Please read the following FAQ:
Buttons do not submit anymore in IE
thank you very very much!
1) What I did is to place the "aspnet_client" folder and it's content in my webapplication-folder,
2) I changed in the WebUIValidation.js - file the following
function ValidatorCommonOnSubmit()
{
event.returnValue = !Page_BlockSubmit;
ret_Val = !Page_BlockSubmit;
Page_BlockSubmit = false;
return ret_Val;
}
3) I entered into the web.config the following :
<system.web>
<webControls clientScriptsLocation="aspnet_client/system_web/1_1_4322/"/>
</system.web>

And now it works !
Thank you again !
Regards,
Fabian

Monday, March 26, 2012

Suggestion for an "imagemap-like" location feature -- methods?

Hi, I'm creating an asp.net application and one of the functions I need
is to click on a "Where Is This Office Located?" button. In a table,
each employee will have an office code location entered.
I then need to have the office layout image load and have the name of
that person highlighted such as bold/red (in the correct office
location).
Similar to an image map, but not quite. I do not want to click on an
office "hotspot" and go to a URL. Not finding anything in my searches
other than typical image map methods.
Any guidance or suggestions much appreciated!
Thanks, Kat
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!Hi Kat,
Actually, nothing at all like an image map. Just an image. However, it has
to be dynamically-generated, as you want to "draw on it."
Let's analyze your requirements:
1. A user clicks on a link or button, or selects an item from a drop-down
list , or what-have-you. (I don't know which you would rather use)
2. A database is queried to get the file location of the appropriate image
and/or information from the database.
3. An office layout image is returned, with the user's name drawn on itin
bold/red letters.
Okay, so you can figure out number 1 for yourself. As for number 2 and 3:
a. The database is queried. Easy enough.
b. The image is fetched from its file location. Easy enough.
c. The image is drawn on. This is done using the System.Drawing and
System.Drawing.Imaging namespaces.
d. The image is returned to the browser. This requires that the image URL
point to an ASPX page that fetches the image, draws on it, sets the
Response.ContentType to "image/jpeg" (whatever MIME type you need), and
saves the image to the Response.OutputStream.
Okay, wait a second. We nede to back up. First, you need to identify the
user. This can be done with a "login" form in which the user supplies a user
id and password, and the data is stored on the server (Session, database,
Application Cache, etc).
That should do it!
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"KatB" <nospam@.comcast.net> wrote in message
news:ebePmxb%23EHA.1296@.TK2MSFTNGP10.phx.gbl...
> Hi, I'm creating an asp.net application and one of the functions I need
> is to click on a "Where Is This Office Located?" button. In a table,
> each employee will have an office code location entered.
> I then need to have the office layout image load and have the name of
> that person highlighted such as bold/red (in the correct office
> location).
> Similar to an image map, but not quite. I do not want to click on an
> office "hotspot" and go to a URL. Not finding anything in my searches
> other than typical image map methods.
> Any guidance or suggestions much appreciated!
> Thanks, Kat
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
Kevin, very helpful, thanks. If I use a floor plan image with all the
office names already on it, and then just add a star graphic or
something to indicate the position requested...how would I know the
position of where to draw the star?
I assume I would have a db table of person, office number, and then the
coordinates of the "star". How would I determine those coordinates?
Sorry, if I'm being stupid!
In the meantime, I'll go read up on system.drawing having not used it
before.
Thanks, Kat
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
Hi Kat, there's a good layer of dust in this part of my mental technical
archives, so I leave the implementation details to you.
As I recall, the original image map technology, which I remember being
referred to as "server side imagemaps", could be used to determine the X, Y
coordinate within an image that a user clicked on. It was fairly
straightforward; you add a tag to your image (ISMAP, maybe) and a Url, and
when the user clicks somewhere on the image, a hit is made to your Url.
Again lots of dust here; check this carefully but I recall that the Url was
in a nonstandard format, something like;
/somepage.aspx?23,48
I.e. you have a querystring but it's not a typical key-value querystring.
You'll need to process it a little differently; grab the entire querystring
and split on the comma, or something similar.
The point is, it should be easy to create an administration page that allows
you to modify the details of an Office record.
Within this page, you could show the floorplan contain the star of the
current location of the office. Then if the admin-user clicks on the
imagemap, you capture the new X, Y, and update the Office record.
This is about the cheapest, crudest, simplest way I can think of to capture
image coordinates through a web app.
If you're lucky, there may be some javascript that can respond to the click,
and allow you to create a true ASP.NET control using true ASP.NET postbacks
and so on. If you're fantastically lucky, someone may have done this for
you already.
The trickiest part will be making sure that you know the OfficeID that the
X, Y should be applied to on the receiving page. You may need to insert the
OfficeID into the Url that's posted back to, so that you can process it out
at the receiving end. On that note, the Hyperlink control may give you the
capabilities you need, or you may be able to derive from it to get the right
capabilities.
Other approaches;
+ Use Flash
+ Use a WinForms application for capturing the X, Y clicks and updating the
Office records
+ Use ASP.NET but give the user some up, down, left, right arrows rather
than the ability to click on the image.
+ Use ASP.NET but put a series of small clickable carats along the top and
left of the floorplan image. These would be standard LinkButtons with a
small graphical carat. Clicking these would set the X or Y, respectively to
a value matching the position of the carat.
+ Build an ActiveX control
+ Build a .NET winforms control that's delivered to the webpage (the user
must have .NET installed however).
HTML is quite limited from this perspective, but I'm fairly certain the
tools are there if you're willing to make them work.
Best of luck;
/// M
"KatB" <nospam@.comcast.net> wrote in message
news:eZdOOVk#EHA.3616@.TK2MSFTNGP11.phx.gbl...
> Kevin, very helpful, thanks. If I use a floor plan image with all the
> office names already on it, and then just add a star graphic or
> something to indicate the position requested...how would I know the
> position of where to draw the star?
> I assume I would have a db table of person, office number, and then the
> coordinates of the "star". How would I determine those coordinates?
> Sorry, if I'm being stupid!
> In the meantime, I'll go read up on system.drawing having not used it
> before.
> Thanks, Kat
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
If you are open to use of commercial components to aid
in your project our MetaDraw control may be helpful
In MetaDraw you would have the office map created along with the
names of the all different individuals as text objects at their proper
locations. Save this layout as a MetaDraw data file. This is
all done ahead of time. Then when user clicks in a list on
a name you want to highlight you can tell MetaDraw to either
Hide all names but the desired name, or show all names but
only highlight ( bold or a bright color ) the desired name.
MetaDraw can be used server side in which case you have
MetaDraw save the resulting image ( with highlighted name, etc)
as a standard GIF, JPG, or PNG file and send that down to
the client. A more flexible approach is to use MetaDraw client
side - Sending the whole layout with all names, and then have
client side script hide or show the names, or even blink a name
on or off. You could also change the color of the room boundaries,
Scroll, Zoom, Print... etc.
Take a look at www.Bennet-Tec.com
Reply here if this seems like something of interest.
* * Please include a copy of this message with your reply
Jeff Bennett
Jeff @. Bennet-Tec.Com
* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com
=================== ===================

Suggestion for an "imagemap-like" location feature -- methods?

Hi, I'm creating an asp.net application and one of the functions I need
is to click on a "Where Is This Office Located?" button. In a table,
each employee will have an office code location entered.

I then need to have the office layout image load and have the name of
that person highlighted such as bold/red (in the correct office
location).

Similar to an image map, but not quite. I do not want to click on an
office "hotspot" and go to a URL. Not finding anything in my searches
other than typical image map methods.

Any guidance or suggestions much appreciated!

Thanks, Kat

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Hi Kat,

Actually, nothing at all like an image map. Just an image. However, it has
to be dynamically-generated, as you want to "draw on it."

Let's analyze your requirements:

1. A user clicks on a link or button, or selects an item from a drop-down
list , or what-have-you. (I don't know which you would rather use)
2. A database is queried to get the file location of the appropriate image
and/or information from the database.
3. An office layout image is returned, with the user's name drawn on itin
bold/red letters.

Okay, so you can figure out number 1 for yourself. As for number 2 and 3:

a. The database is queried. Easy enough.
b. The image is fetched from its file location. Easy enough.
c. The image is drawn on. This is done using the System.Drawing and
System.Drawing.Imaging namespaces.
d. The image is returned to the browser. This requires that the image URL
point to an ASPX page that fetches the image, draws on it, sets the
Response.ContentType to "image/jpeg" (whatever MIME type you need), and
saves the image to the Response.OutputStream.

Okay, wait a second. We nede to back up. First, you need to identify the
user. This can be done with a "login" form in which the user supplies a user
id and password, and the data is stored on the server (Session, database,
Application Cache, etc).

That should do it!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"KatB" <nospam@.comcast.net> wrote in message
news:ebePmxb%23EHA.1296@.TK2MSFTNGP10.phx.gbl...
> Hi, I'm creating an asp.net application and one of the functions I need
> is to click on a "Where Is This Office Located?" button. In a table,
> each employee will have an office code location entered.
> I then need to have the office layout image load and have the name of
> that person highlighted such as bold/red (in the correct office
> location).
> Similar to an image map, but not quite. I do not want to click on an
> office "hotspot" and go to a URL. Not finding anything in my searches
> other than typical image map methods.
> Any guidance or suggestions much appreciated!
> Thanks, Kat
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Kevin, very helpful, thanks. If I use a floor plan image with all the
office names already on it, and then just add a star graphic or
something to indicate the position requested...how would I know the
position of where to draw the star?

I assume I would have a db table of person, office number, and then the
coordinates of the "star". How would I determine those coordinates?
Sorry, if I'm being stupid!

In the meantime, I'll go read up on system.drawing having not used it
before.

Thanks, Kat

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Hi Kat, there's a good layer of dust in this part of my mental technical
archives, so I leave the implementation details to you.

As I recall, the original image map technology, which I remember being
referred to as "server side imagemaps", could be used to determine the X, Y
coordinate within an image that a user clicked on. It was fairly
straightforward; you add a tag to your image (ISMAP, maybe) and a Url, and
when the user clicks somewhere on the image, a hit is made to your Url.
Again lots of dust here; check this carefully but I recall that the Url was
in a nonstandard format, something like;

/somepage.aspx?23,48

I.e. you have a querystring but it's not a typical key-value querystring.
You'll need to process it a little differently; grab the entire querystring
and split on the comma, or something similar.

The point is, it should be easy to create an administration page that allows
you to modify the details of an Office record.

Within this page, you could show the floorplan contain the star of the
current location of the office. Then if the admin-user clicks on the
imagemap, you capture the new X, Y, and update the Office record.

This is about the cheapest, crudest, simplest way I can think of to capture
image coordinates through a web app.

If you're lucky, there may be some javascript that can respond to the click,
and allow you to create a true ASP.NET control using true ASP.NET postbacks
and so on. If you're fantastically lucky, someone may have done this for
you already.

The trickiest part will be making sure that you know the OfficeID that the
X, Y should be applied to on the receiving page. You may need to insert the
OfficeID into the Url that's posted back to, so that you can process it out
at the receiving end. On that note, the Hyperlink control may give you the
capabilities you need, or you may be able to derive from it to get the right
capabilities.

Other approaches;

+ Use Flash
+ Use a WinForms application for capturing the X, Y clicks and updating the
Office records
+ Use ASP.NET but give the user some up, down, left, right arrows rather
than the ability to click on the image.
+ Use ASP.NET but put a series of small clickable carats along the top and
left of the floorplan image. These would be standard LinkButtons with a
small graphical carat. Clicking these would set the X or Y, respectively to
a value matching the position of the carat.
+ Build an ActiveX control
+ Build a .NET winforms control that's delivered to the webpage (the user
must have .NET installed however).

HTML is quite limited from this perspective, but I'm fairly certain the
tools are there if you're willing to make them work.

Best of luck;

/// M

"KatB" <nospam@.comcast.net> wrote in message
news:eZdOOVk#EHA.3616@.TK2MSFTNGP11.phx.gbl...
> Kevin, very helpful, thanks. If I use a floor plan image with all the
> office names already on it, and then just add a star graphic or
> something to indicate the position requested...how would I know the
> position of where to draw the star?
> I assume I would have a db table of person, office number, and then the
> coordinates of the "star". How would I determine those coordinates?
> Sorry, if I'm being stupid!
> In the meantime, I'll go read up on system.drawing having not used it
> before.
> Thanks, Kat
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
If you are open to use of commercial components to aid
in your project our MetaDraw control may be helpful

In MetaDraw you would have the office map created along with the
names of the all different individuals as text objects at their proper
locations. Save this layout as a MetaDraw data file. This is
all done ahead of time. Then when user clicks in a list on
a name you want to highlight you can tell MetaDraw to either
Hide all names but the desired name, or show all names but
only highlight ( bold or a bright color ) the desired name.

MetaDraw can be used server side in which case you have
MetaDraw save the resulting image ( with highlighted name, etc)
as a standard GIF, JPG, or PNG file and send that down to
the client. A more flexible approach is to use MetaDraw client
side - Sending the whole layout with all names, and then have
client side script hide or show the names, or even blink a name
on or off. You could also change the color of the room boundaries,
Scroll, Zoom, Print... etc.

Take a look at www.Bennet-Tec.com

Reply here if this seems like something of interest.

* * Please include a copy of this message with your reply

Jeff Bennett
Jeff @. Bennet-Tec.Com

* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com
=================== ===================

Thursday, March 22, 2012

Support

is it possible to invoke an hour glass in my asp .net application when I
invoke a user action such as clicking a button.
I've tried putting "Document.style.cursor=Wait" in the beginning of the
JavaScript function and changing the cursor back to "Default" at the end,
but of no use.

My problem is that the cursor is changing to the hour glass only after the
entire function gets executed, which makes the purpose nullified. Please let
me know what I can do in this aspect or is there any way I can forcefully
invoke the hour glass (or at least some flashy progress bar) immediately
after I click the button.You can place on JavaScript that changes to hourglass, then run the rest of
the code, then change it back. It is also possible to place a "waiting"
layer up for the user and then have client side script make the layer
invisible.

There is not much else you can do, as you are running all code on the client
side.

BTW< some of the groups you have crossposted are really not on topic.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Support" <anonymous@.discussions.com> wrote in message
news:eqTg$tITEHA.3768@.TK2MSFTNGP11.phx.gbl...
> is it possible to invoke an hour glass in my asp .net application when I
> invoke a user action such as clicking a button.
> I've tried putting "Document.style.cursor=Wait" in the beginning of the
> JavaScript function and changing the cursor back to "Default" at the end,
> but of no use.
> My problem is that the cursor is changing to the hour glass only after the
> entire function gets executed, which makes the purpose nullified. Please
let
> me know what I can do in this aspect or is there any way I can forcefully
> invoke the hour glass (or at least some flashy progress bar) immediately
> after I click the button.

Support

is it possible to invoke an hour glass in my asp .net application when I
invoke a user action such as clicking a button.
I've tried putting "Document.style.cursor=Wait" in the beginning of the
JavaScript function and changing the cursor back to "Default" at the end,
but of no use.
My problem is that the cursor is changing to the hour glass only after the
entire function gets executed, which makes the purpose nullified. Please let
me know what I can do in this aspect or is there any way I can forcefully
invoke the hour glass (or at least some flashy progress bar) immediately
after I click the button.You can place on JavaScript that changes to hourglass, then run the rest of
the code, then change it back. It is also possible to place a "waiting"
layer up for the user and then have client side script make the layer
invisible.
There is not much else you can do, as you are running all code on the client
side.
BTW< some of the groups you have crossposted are really not on topic.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
****************************************
********
Think Outside the Box!
****************************************
********
"Support" <anonymous@.discussions.com> wrote in message
news:eqTg$tITEHA.3768@.TK2MSFTNGP11.phx.gbl...
> is it possible to invoke an hour glass in my asp .net application when I
> invoke a user action such as clicking a button.
> I've tried putting "Document.style.cursor=Wait" in the beginning of the
> JavaScript function and changing the cursor back to "Default" at the end,
> but of no use.
> My problem is that the cursor is changing to the hour glass only after the
> entire function gets executed, which makes the purpose nullified. Please
let
> me know what I can do in this aspect or is there any way I can forcefully
> invoke the hour glass (or at least some flashy progress bar) immediately
> after I click the button.
>

Suppress Form Action

A custom server control has a Button.

Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property

Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClic k,
"ConfirmMsg()")
End Sub

Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)

Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace

Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):

<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>

<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>

Note the

Output.Write("location.href = window.location.href + '?Proceed=' +
answer")

line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.

What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to

http://myserver/aspx/Confirm.aspx?Proceed=true
If the user clicks 'Cancel' in the confirm dialog, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=false
Can this be done in anyway?Anyone?

rn5a@.rediffmail.com wrote:

Quote:

Originally Posted by

A custom server control has a Button.
>
Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property
>
Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClic k,
"ConfirmMsg()")
End Sub
>
Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)
>
Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace
>
Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):
>
<%@. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
>
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>
>
Note the
>
Output.Write("location.href = window.location.href + '?Proceed=' +
answer")
>
line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.
>
What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to
>
http://myserver/aspx/Confirm.aspx?Proceed=true
>
If the user clicks 'Cancel' in the confirm dialog, he will be taken to
>
http://myserver/aspx/Confirm.aspx?Proceed=false
>
Can this be done in anyway?

Suppress Form Action

A custom server control has a Button.

Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property

Protected Overrides Sub AddAttributesToRender(ByVal Output As HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClick, "ConfirmMsg()")
End Sub

Protected Overrides Sub RenderContents(ByVal Output As HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)

Output.Write("location.href = window.location.href + '?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace

Using VBC, I compiled the above intoConfirm.dll. This is how I am using the above custom control in an ASPX page (assume that the ASPX page is namedConfirm.aspx):

<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?" Text="EXIT" runat="server"/>
</form>

Note the

Output.Write("location.href = window.location.href + '?Proceed=' + answer")

line (which is highlighted) in the VB class file code. When the ASPX page gets rendered, it displays a Button. Conventionally, when a Button is clicked in an ASPX page, it posts back to itself using the POST method. When the Button in the above custom control is clicked, a JavaScriptconfirm dialog pops-up with 2 buttons -OK &Cancel. IfOK is clicked, the value of the JavaScript variableanswer istrue & ifCancel is clicked, the value of the variableanswer isfalse.

What I want is irrespective of whether a user clicks theOK orCancel button in theconfirm dialog, instead of posting back to itself using the conventional POST method, I want the ASPX page to post to itself BUT with a querystringProceed=<value> appended i.e. I want to suppress the conventional post & instead add the querystring so that I can find out whether the user has clicked theOK button or theCancel button in theconfirm dialog. If the user clicksOK, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=true

On the other hand, if the user clicksCancel in theconfirm dialog, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=false

Can this be done in anyway?

Output.AddAttribute(HtmlTextWriterAttribute.OnClick, "ConfirmMsg();return false;")


Thanks, mate, your suggestion turned out to be a great one. Could you please tell me what role doesreturn=false; which you have appended afterConfirmMsg(), play here?

Going by your suggestion does add the querystringProceed=<value> at the end of the URL but there's a *** here. Suppose when a user clicks the server-side Button; he is shown the JavaScriptconfirm dialog with theOK &Cancel buttons. If the user clicksOK, then he is taken to

http://myserver/aspx/Confirm.aspx?Proceed=true

That's fine but if the user clicks the server-side Button once again & clicksCancel in theconfirm dialog, then he is taken to

http://myserver/aspx/Confirm.aspx?Proceed=true?Proceed=false

i.e. the querystring gets appended twice. In other words, a querystringProceed=<value> will go on getting appended at the URL wheneverOK &Cancel is clicked in the JavaScriptconfirm dialog. For e.g. if a user clicks eitherOK orCancel in theconfirm dialog 5 times, then the querystring will get appended one after the other 5 times.

Any workaround to overcome this?

Suppress Form Action

A custom server control has a Button.
Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property
Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClick,
"ConfirmMsg()")
End Sub
Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)
Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace
Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):
<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>
Note the
Output.Write("location.href = window.location.href + '?Proceed=' +
answer")
line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.
What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to
http://myserver/aspx/Confirm.aspx?Proceed=true
If the user clicks 'Cancel' in the confirm dialog, he will be taken to
http://myserver/aspx/Confirm.aspx?Proceed=false
Can this be done in anyway?Anyone?
rn5a@.rediffmail.com wrote:
> A custom server control has a Button.
> Namespace Confirm
> Public Class ShowConfirm : Inherits Button
> Private strConfirmMsg As String
> Public Property ConfirmMessage() As String
> Get
> ConfirmMessage = strConfirmMsg
> End Get
> Set(ByVal value As String)
> strConfirmMsg = value
> End Set
> End Property
> Protected Overrides Sub AddAttributesToRender(ByVal Output As
> HtmlTextWriter)
> MyBase.AddAttributesToRender(Output)
> Output.AddAttribute(HtmlTextWriterAttribute.OnClick,
> "ConfirmMsg()")
> End Sub
> Protected Overrides Sub RenderContents(ByVal Output As
> HtmlTextWriter)
> Output.Write(vbCrLf)
> Output.Write("<script language='JavaScript'>")
> Output.Write(vbCrLf)
> Output.Write("function ConfirmMsg(){")
> Output.Write(vbCrLf)
> Output.Write("var answer = confirm('")
> Output.Write(strConfirmMsg)
> Output.Write("')")
> Output.Write(vbCrLf)
> Output.Write("location.href = window.location.href +
> '?Proceed=' + answer")
> Output.Write(vbCrLf)
> Output.Write("}")
> Output.Write(vbCrLf)
> Output.Write("</script>")
> End Sub
> End Class
> End Namespace
> Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
> using the above custom control in an ASPX page (assume that the ASPX
> page is named Confirm.aspx):
> <%@. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
> <form EnableViewState="true" runat="server">
> <CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
> Text="EXIT" runat="server"/>
> </form>
> Note the
> Output.Write("location.href = window.location.href + '?Proceed=' +
> answer")
> line in the VB class file code. When the ASPX page gets rendered, it
> displays a Button. Conventionally, when a Button is clicked in an ASPX
> page, it posts back to itself using the POST method. When the Button in
> the above custom control is clicked, a JavaScript confirm dialog
> pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
> of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
> the value of the variable 'answer' is false.
> What I want is irrespective of whether a user clicks the 'OK' or
> 'Cancel' button in the confirm dialog, instead of posting back to
> itself using the conventional POST method, I want the ASPX page to post
> to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
> to suppress the conventional post & instead add the querystring so that
> I can find out whether the user has clicked the 'OK' button or the
> 'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
> be taken to
> http://myserver/aspx/Confirm.aspx?Proceed=true
> If the user clicks 'Cancel' in the confirm dialog, he will be taken to
> http://myserver/aspx/Confirm.aspx?Proceed=false
> Can this be done in anyway?

suppressing Submit command with a Delete button

I have a Delete button in my datagrid. I'm attempting to add some code
confirming whether the user wishes to really delete the item or not.

The confirm pops up, but I cannot suppress the submission when selecting
Cancel.

Heres what I have so far:

' adding the javascript call to the button:
Private Sub dgItem_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgItem.ItemCreated

If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
ListItemType.AlternatingItem Then

Dim objDeleteButton As Button = CType(e.Item.Cells(1).Controls(0), Button)

objDeleteButton.CssClass = "inputbutton"

objDeleteButton.Attributes.Add("onClick", "confirmDeleteItem();")

End If

End Sub

' client side code in javascript

function confirmDeleteItem()

{

if (confirm("Are you sure you wish to delete this item?"))

{

return true;

}

else

{

return false;

}

}

any help is appreciated. thank you.Sounds like you have validation controls on there, which causes the runtime
to emit yet another onClick handler which submits the form. Try using an
<input type="button"> instead of an <asp:button> control, and if you need
validation just script in the validation call (and, as always, make sure you
explicitly validate on the server, as client side validation is easy to
foil).

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Elliot M. Rodriguez" <elliotmrodriguezatnospamhotmail.com> wrote in message
news:%23xSgcJ$wDHA.2092@.TK2MSFTNGP09.phx.gbl...
> I have a Delete button in my datagrid. I'm attempting to add some code
> confirming whether the user wishes to really delete the item or not.
> The confirm pops up, but I cannot suppress the submission when selecting
> Cancel.
> Heres what I have so far:
> ' adding the javascript call to the button:
> Private Sub dgItem_ItemCreated(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgItem.ItemCreated
> If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
> ListItemType.AlternatingItem Then
> Dim objDeleteButton As Button = CType(e.Item.Cells(1).Controls(0), Button)
> objDeleteButton.CssClass = "inputbutton"
> objDeleteButton.Attributes.Add("onClick", "confirmDeleteItem();")
> End If
> End Sub
>
> ' client side code in javascript
> function confirmDeleteItem()
> {
> if (confirm("Are you sure you wish to delete this item?"))
> {
> return true;
> }
> else
> {
> return false;
> }
> }
> any help is appreciated. thank you.
Chris:

Thanks for the reply. I am struggling with this.

If I take your approach it seems I dont have the ability to wire it to the
DeleteCommand event. This means I have to access the DataKey for the row
through the client, which I dont want to do. I could be wrong on this
though.

All I really want to do is have a DeleteCommand button that performs a
delete with a confirmation prior to deletion. My code does not have any
other validators on the page. There is another button on the page, but
performs a completely unrelated task.

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:uV5h$Y$wDHA.3220@.tk2msftngp13.phx.gbl...
> Sounds like you have validation controls on there, which causes the
runtime
> to emit yet another onClick handler which submits the form. Try using an
> <input type="button"> instead of an <asp:button> control, and if you need
> validation just script in the validation call (and, as always, make sure
you
> explicitly validate on the server, as client side validation is easy to
> foil).
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows Client
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
> "Elliot M. Rodriguez" <elliotmrodriguezatnospamhotmail.com> wrote in
message
> news:%23xSgcJ$wDHA.2092@.TK2MSFTNGP09.phx.gbl...
> > I have a Delete button in my datagrid. I'm attempting to add some code
> > confirming whether the user wishes to really delete the item or not.
> > The confirm pops up, but I cannot suppress the submission when selecting
> > Cancel.
> > Heres what I have so far:
> > ' adding the javascript call to the button:
> > Private Sub dgItem_ItemCreated(ByVal sender As Object, ByVal e As
> > System.Web.UI.WebControls.DataGridItemEventArgs) Handles
> dgItem.ItemCreated
> > If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
> > ListItemType.AlternatingItem Then
> > Dim objDeleteButton As Button = CType(e.Item.Cells(1).Controls(0),
Button)
> > objDeleteButton.CssClass = "inputbutton"
> > objDeleteButton.Attributes.Add("onClick", "confirmDeleteItem();")
> > End If
> > End Sub
> > ' client side code in javascript
> > function confirmDeleteItem()
> > {
> > if (confirm("Are you sure you wish to delete this item?"))
> > {
> > return true;
> > }
> > else
> > {
> > return false;
> > }
> > }
> > any help is appreciated. thank you.
Aha - that's a special case I hadn't considered.

Try this article:

http://authors.aspalliance.com/aldo...xamples/cd.aspx

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Elliot M. Rodriguez" <someemail> wrote in message
news:ucDxzLAxDHA.2460@.TK2MSFTNGP10.phx.gbl...
> Chris:
> Thanks for the reply. I am struggling with this.
> If I take your approach it seems I dont have the ability to wire it to the
> DeleteCommand event. This means I have to access the DataKey for the row
> through the client, which I dont want to do. I could be wrong on this
> though.
> All I really want to do is have a DeleteCommand button that performs a
> delete with a confirmation prior to deletion. My code does not have any
> other validators on the page. There is another button on the page, but
> performs a completely unrelated task.
>
> "Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
> news:uV5h$Y$wDHA.3220@.tk2msftngp13.phx.gbl...
> > Sounds like you have validation controls on there, which causes the
> runtime
> > to emit yet another onClick handler which submits the form. Try using an
> > <input type="button"> instead of an <asp:button> control, and if you
need
> > validation just script in the validation call (and, as always, make sure
> you
> > explicitly validate on the server, as client side validation is easy to
> > foil).
> > --
> > Chris Jackson
> > Software Engineer
> > Microsoft MVP - Windows Client
> > Windows XP Associate Expert
> > --
> > More people read the newsgroups than read my email.
> > Reply to the newsgroup for a faster response.
> > (Control-G using Outlook Express)
> > --
> > "Elliot M. Rodriguez" <elliotmrodriguezatnospamhotmail.com> wrote in
> message
> > news:%23xSgcJ$wDHA.2092@.TK2MSFTNGP09.phx.gbl...
> > > I have a Delete button in my datagrid. I'm attempting to add some code
> > > confirming whether the user wishes to really delete the item or not.
> > > > The confirm pops up, but I cannot suppress the submission when
selecting
> > > Cancel.
> > > > Heres what I have so far:
> > > > ' adding the javascript call to the button:
> > > Private Sub dgItem_ItemCreated(ByVal sender As Object, ByVal e As
> > > System.Web.UI.WebControls.DataGridItemEventArgs) Handles
> > dgItem.ItemCreated
> > > > If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
> > > ListItemType.AlternatingItem Then
> > > > Dim objDeleteButton As Button = CType(e.Item.Cells(1).Controls(0),
> Button)
> > > > objDeleteButton.CssClass = "inputbutton"
> > > > objDeleteButton.Attributes.Add("onClick", "confirmDeleteItem();")
> > > > End If
> > > > End Sub
> > > > > > ' client side code in javascript
> > > > function confirmDeleteItem()
> > > > {
> > > > if (confirm("Are you sure you wish to delete this item?"))
> > > > {
> > > > return true;
> > > > }
> > > > else
> > > > {
> > > > return false;
> > > > }
> > > > }
> > > > any help is appreciated. thank you.
> >
Chris:

I realized I forgot the lousy "return" keyword in Attributes.Add lol...
Thanks for the article and the help.

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:OwfPeBBxDHA.1196@.TK2MSFTNGP12.phx.gbl...
> Aha - that's a special case I hadn't considered.
> Try this article:
> http://authors.aspalliance.com/aldo...xamples/cd.aspx
>
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows Client
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
> "Elliot M. Rodriguez" <someemail> wrote in message
> news:ucDxzLAxDHA.2460@.TK2MSFTNGP10.phx.gbl...
> > Chris:
> > Thanks for the reply. I am struggling with this.
> > If I take your approach it seems I dont have the ability to wire it to
the
> > DeleteCommand event. This means I have to access the DataKey for the row
> > through the client, which I dont want to do. I could be wrong on this
> > though.
> > All I really want to do is have a DeleteCommand button that performs a
> > delete with a confirmation prior to deletion. My code does not have any
> > other validators on the page. There is another button on the page, but
> > performs a completely unrelated task.
> > "Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
> > news:uV5h$Y$wDHA.3220@.tk2msftngp13.phx.gbl...
> > > Sounds like you have validation controls on there, which causes the
> > runtime
> > > to emit yet another onClick handler which submits the form. Try using
an
> > > <input type="button"> instead of an <asp:button> control, and if you
> need
> > > validation just script in the validation call (and, as always, make
sure
> > you
> > > explicitly validate on the server, as client side validation is easy
to
> > > foil).
> > > > --
> > > Chris Jackson
> > > Software Engineer
> > > Microsoft MVP - Windows Client
> > > Windows XP Associate Expert
> > > --
> > > More people read the newsgroups than read my email.
> > > Reply to the newsgroup for a faster response.
> > > (Control-G using Outlook Express)
> > > --
> > > > "Elliot M. Rodriguez" <elliotmrodriguezatnospamhotmail.com> wrote in
> > message
> > > news:%23xSgcJ$wDHA.2092@.TK2MSFTNGP09.phx.gbl...
> > > > I have a Delete button in my datagrid. I'm attempting to add some
code
> > > > confirming whether the user wishes to really delete the item or not.
> > > > > > The confirm pops up, but I cannot suppress the submission when
> selecting
> > > > Cancel.
> > > > > > Heres what I have so far:
> > > > > > ' adding the javascript call to the button:
> > > > Private Sub dgItem_ItemCreated(ByVal sender As Object, ByVal e As
> > > > System.Web.UI.WebControls.DataGridItemEventArgs) Handles
> > > dgItem.ItemCreated
> > > > > > If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
> > > > ListItemType.AlternatingItem Then
> > > > > > Dim objDeleteButton As Button = CType(e.Item.Cells(1).Controls(0),
> > Button)
> > > > > > objDeleteButton.CssClass = "inputbutton"
> > > > > > objDeleteButton.Attributes.Add("onClick", "confirmDeleteItem();")
> > > > > > End If
> > > > > > End Sub
> > > > > > > > > > ' client side code in javascript
> > > > > > function confirmDeleteItem()
> > > > > > {
> > > > > > if (confirm("Are you sure you wish to delete this item?"))
> > > > > > {
> > > > > > return true;
> > > > > > }
> > > > > > else
> > > > > > {
> > > > > > return false;
> > > > > > }
> > > > > > }
> > > > > > any help is appreciated. thank you.
> > > > > >

Tuesday, March 13, 2012

Switch Off IE (Internet Explorer) Toolbars?

Hi All,

Can anoyone tell me how to:

Switch Off IE (Internet Explorer) Toolbars when my browser windo opens in my application.

crte a button that will close my page

cheers

any help most appreciated

rgs

TonyHi Tony,
You can not do it in current window. You can instead open new window without toolbars and close current. Seethis.
Hi

Thanks for that, just one question...where do I insert in in the asp.net page as I already have script tags with asp.net in them!!!

many thanks

Tony
Hi,

I have use default.aspx that redirects to app mainpage:

private void Page_Load(object sender, System.EventArgs e)
{
string apu = "/Application/AppMainPage.aspx";

string Script = "";

Script += "\n<script language=JavaScript id='StartMainWindow'>\n";
Script += "poppedwin = window.open('"+apu+"','Appmain','resizable=yes, width=1024,height=768,statusbar=no'); \n";
Script += "mainwindow = window.self; \n";
Script += "mainwindow.opener = window.self; \n";
Script += "mainwindow.close(); \n";
Script += "poppedwin.focus(); \n";
Script += "</script>";

Response.Write(Script);
Response.End();
}

I hope this helps.

- Antti -
Hi Tony,
You can insert client script tag anywhere you want (and more then one). Client script tags have no runat="server" attributes and processed differently from server side asp.net script tag.