943,929 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 29622
  • ASP.NET RSS
Jun 13th, 2007
0

"i want used confirm in javascript in code behind"

Expand Post »
Hai....

"i want used confirm in javascript in code behind"

i am used confirm button ,,,in code behind.

if the confirm button worked

the function is return the true...

else

the function return the false..

i want to get true and false value for my further proces..

this my code..

Dim popupScript6 As String = "<script language='javascript'>var agree= confirm('Are you sure to cancel the ticket?');if(agree){ return true};else {return false;}</script>"
'Page.RegisterStartupScript("PopupScript6", popupScript6)

in my codebehind window i want to get "agree" value....

in this popupScript6 used confirm coding is worked...but i wrote return word..this is nothing done..

i ma used return word is not worked..

please how can use this statement..

how can i get return value..

because i got the return value..

then my next code if(true) the redirect to another page...

so please hrlp me...

i am used this code also code..

but the same process done this also return word is used in not working..

this code..

Dim str As StringBuilder = New StringBuilder
str.Append("<script language='javascript'>")

str.Append("var agree= confirm('Are you sure to cancel the ticket?');")
str.Append("if(agree){")

str.Append("return true;}")
str.Append("else {")

str.Append("return false;}")
str.Append("</script>")
RegisterStartupScript("TicketNumber", str.ToString)

so please help me...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thirunavukaras is offline Offline
23 posts
since May 2007
Jun 14th, 2007
0

Re: "i want used confirm in javascript in code behind"

.
Last edited by NET-Developer; Jun 14th, 2007 at 10:10 am. Reason: was posted by mistake, just do not know how to delete post
Reputation Points: 10
Solved Threads: 1
Newbie Poster
NET-Developer is offline Offline
18 posts
since May 2007
Jun 14th, 2007
0

Re: "i want used confirm in javascript in code behind"

Put your JS-code into some function like
function MyFunction()
{
... your code
}

And call this function by onClick event of your button (onClick="if(MyFunction()) { window.location.href='where.you.want.to.redirect'; }")
Last edited by NET-Developer; Jun 14th, 2007 at 10:07 am. Reason: it was posted uncompleted
Reputation Points: 10
Solved Threads: 1
Newbie Poster
NET-Developer is offline Offline
18 posts
since May 2007
Jun 20th, 2007
0

Re: "i want used confirm in javascript in code behind"

Hi dear....

This is my 1st Post...

RegisterStartupScript("Alert", "<script language=""javascript"">Confirm('Are you sure ');</script>")

this is the Best way to call javascript inside the Code....this should b written in Code behind file mean in .apsx.vb file....

I hope that you get Help from the Post...

Bye

Regards
Pushkar
Reputation Points: 10
Solved Threads: 1
Newbie Poster
pushkar_it is offline Offline
11 posts
since Jun 2007
Nov 7th, 2009
0
Re: "i want used confirm in javascript in code behind"
i am using update pannel ,how to use this function at code behind
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Rajasundar is offline Offline
1 posts
since Nov 2009
Nov 7th, 2009
0

Regarding Update Panel

Click to Expand / Collapse  Quote originally posted by Rajasundar ...
i am using update pannel ,how to use this function at code behind
Hi Raja.
Follow this link

When u want to use RegisterStartUpScript within update panel u need to Call function from ScriptManager not from ClientScript...

http://developers.de/blogs/damir_dob...3F002100_.aspx

ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), Msg2, True)
Reputation Points: 10
Solved Threads: 1
Newbie Poster
pushkar_it is offline Offline
11 posts
since Jun 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in ASP.NET Forum Timeline: c# with vb in asp.net
Next Thread in ASP.NET Forum Timeline: How to upgrade a ASP .NET website to AJAX enabled website?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC