executing severside code only after entering value in radprompt

Posted by Arun11 under ASP.NET on 7/28/2011 | Points: 10 | Views : 1993 | Status : [Member] | Replies : 1
Hi,

Somebody help me please.I am stuck with this.
<script type="text/javascript">
function openPrompt() {
radprompt("please enter the file name", CallBackFn);

}
function CallBackFn(arg) {
document.getElementById("<%=hdnField1.ClientID%>").value = arg;
}

</script>
I have specified onClientClick="openPrompt()" in the button control.But this directly executes the serverside code.but it should execute server side code only after i enter the file name and click ok.please help.

Thanks.




Responses

Posted by: Hmanjarawala on: 8/5/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi Arun,

Type your javascript as below:
<script type="text/javascript">
function openPrompt() {
radprompt("please enter the file name", CallBackFn);
return true;
}
function CallBackFn(arg) {
document.getElementById("<%=hdnField1.ClientID%>").value = arg;
}
and specified clientclick event like:
onClientClick="return openPrompt()"

Hope this code will help you
</script>


Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Arun11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response