Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to response from client

Reply
Thread Tools

How to response from client

 
 
Mei leng Leong
Guest
Posts: n/a
 
      08-25-2004
HI kindly helper,

i'm facing a problem with javascript rendering from code-behind. i'm
prompt a confirmation message to client. Would like to get response from
client. then will proceed further action depend on the response on the
client.

my coding is


<script language=javascript>
function __doPostBack(eventTarget, eventArgument)
{
var theform = document.Form1;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<!-- Add two hidden variables used in __doPostBack-->
<input type="hidden" name="__EVENTTARGET">
<input type="hidden" name="__EVENTARGUMENT">
<asp:TextBox ID="txt1" Runat="server"></asp:TextBox>
<asp:Button ID="btnsubmit" Runat="server" text="submit"></asp:Button>
<asp:Button ID="hiddenbtn" Runat="server" Visible="False"></asp:Button>
</form>
========================================>
Code behind


Private Sub btnsubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnsubmit.Click
Dim errmsg As String
errmsg = "<script language=javascript>" & Chr(13)
errmsg += "if (confirm(""record exist. To Continue!""))" & Chr(13)
errmsg += " __doPostBack('hiddenbtn','');" & Chr(13)
' errmsg += Chr(13)
' errmsg += " function fndoPostBack2(eventTarget, eventArgument) " &
Chr(13)
' errmsg += "{" & Chr(13)
'errmsg += " var theform = document.Form1;" & Chr(13)
'errmsg += " theform.__EVENTTARGET.value = eventTarget;" & Chr(13)
'errmsg += " theform.__EVENTARGUMENT.value = eventArgument;" & Chr(13)
'errmsg += " theform.submit();" & Chr(13)
errmsg += " }" & Chr(13)
errmsg += "</script>"
Response.Write(errmsg)
End Sub
===========================>
My question:
1.when i render the javascript function fndopostback2 together will give
me __EVENTARGUMENT is null

2.if i only render the javascript confirm the __doPostback error
message is object expected form javascript.

is anybody have idea to solve this or any suggestion to do this. thank
you very much.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Frames and Response.Redirect / Response.Write - Refresh Charles A. Lackman ASP .Net 2 01-11-2006 11:44 PM
Response.Write and Response.Redirect Sehboo ASP .Net 3 12-10-2003 03:43 PM
Response.Expires and Response.Cache Promenade ASP .Net 2 12-05-2003 06:41 PM
Response.Write and Response.Redirect Matthew Wieder ASP .Net 4 07-17-2003 05:33 PM



Advertisments