Re: how do I call a code-behind procedure from javascript?
Re: how do I call a code-behind procedure from javascript?
am 30.03.2008 21:14:45 von smar
Why don't you just use a Button server control and your problem is solved?
"Keith G Hicks" wrote in message
news:OO2EYVpkIHA.3512@TK2MSFTNGP03.phx.gbl...
> I'm working on an asp.net 2 app.
>
> I had a page with an input button on it as shown here:
>
>
>
> I need that button to run some code behind code that will update some data
> in the associated sql 2005 dababase. I know how to write the codebehind
> procedure That's not a problem. The problem is getting the javascript in
> the
> input button to run the code behind procedure.
>
> When I double clicked the input button (in the VWD designer) it of course
> changed the definition of the button as follows:
>
>
> language="javascript" onclick="return btnPost_onclick()" />
>
> and added the following to the page:
>
>
>
>
> I have this in the code behind file:
>
> Partial Class Admin_MissingClasssmateSubmissions
> Inherits System.Web.UI.Page
>
> Protected Sub PostMissingClassmateData()
> 'This code will run a stored procedure in the backend
>
> End Sub
>
> End Class
>
> Thanks,
>
> Keith
>
>
how do I call a code-behind procedure from javascript?
am 30.03.2008 21:39:27 von Keith G Hicks
I'm working on an asp.net 2 app.
I had a page with an input button on it as shown here:
I need that button to run some code behind code that will update some data
in the associated sql 2005 dababase. I know how to write the codebehind
procedure That's not a problem. The problem is getting the javascript in the
input button to run the code behind procedure.
When I double clicked the input button (in the VWD designer) it of course
changed the definition of the button as follows:
Partial Class Admin_MissingClasssmateSubmissions
Inherits System.Web.UI.Page
Protected Sub PostMissingClassmateData()
'This code will run a stored procedure in the backend
End Sub
End Class
Thanks,
Keith
Re: how do I call a code-behind procedure from javascript?
am 30.03.2008 22:10:27 von unknown
__doPostback('yourcontrolname') Something like that, you will see it in the
existing code.
"Scott M." wrote in message
news:eRny8npkIHA.6032@TK2MSFTNGP03.phx.gbl...
> Why don't you just use a Button server control and your problem is solved?
>
>
> "Keith G Hicks" wrote in message
> news:OO2EYVpkIHA.3512@TK2MSFTNGP03.phx.gbl...
>> I'm working on an asp.net 2 app.
>>
>> I had a page with an input button on it as shown here:
>>
>>
>>
>> I need that button to run some code behind code that will update some
>> data
>> in the associated sql 2005 dababase. I know how to write the codebehind
>> procedure That's not a problem. The problem is getting the javascript in
>> the
>> input button to run the code behind procedure.
>>
>> When I double clicked the input button (in the VWD designer) it of course
>> changed the definition of the button as follows:
>>
>>
>> language="javascript" onclick="return btnPost_onclick()" />
>>
>> and added the following to the page:
>>
>>
>>
>>
>> I have this in the code behind file:
>>
>> Partial Class Admin_MissingClasssmateSubmissions
>> Inherits System.Web.UI.Page
>>
>> Protected Sub PostMissingClassmateData()
>> 'This code will run a stored procedure in the backend
>>
>> End Sub
>>
>> End Class
>>
>> Thanks,
>>
>> Keith
>>
>>
>
>
Re: how do I call a code-behind procedure from javascript?
am 31.03.2008 01:08:02 von Keith G Hicks
Never mind. I decided to alter the business rules for this issue. It no
longer applies.