•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 363,513 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,442 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 4733 | Replies: 3
![]() |
•
•
Join Date: May 2007
Posts: 23
Reputation:
Rep Power: 2
Solved Threads: 0
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...
"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...
•
•
Join Date: May 2007
Posts: 18
Reputation:
Rep Power: 2
Solved Threads: 1
.
Last edited by NET-Developer : Jun 14th, 2007 at 9:10 am. Reason: was posted by mistake, just do not know how to delete post
•
•
Join Date: May 2007
Posts: 18
Reputation:
Rep Power: 2
Solved Threads: 1
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'; }")
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 9:07 am. Reason: it was posted uncompleted
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
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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
.net .net framework 3.0 access activation ajax api asp blogger blogging blogs code combo custom dani daniweb data debugging development dropdownlist feed firefox gdata google gpl html innovation javascript key linux microsoft module net news office openbsd product programming reader reuse rss serial skin source tags theme vista web windows workflow wysiwyg xml
- "<SCRIPT SRC>" javascript logon help (JavaScript / DHTML / AJAX)
- How to make javascript form autochange - "Onchange"? (JavaScript / DHTML / AJAX)
- Using Javascript code in ASP.NET (JavaScript / DHTML / AJAX)
Other Threads in the ASP.NET Forum
- Previous Thread: Validation control
- Next Thread: Free Wysiwyg Editor


Linear Mode