So, the first thing that has to be clear is this, you want when the guy clicks on the "tag" it to give a post on the page or you want to do this with javascript?
If you want to give a post, you need to enable this "tag" control with a runat="server", thus, with a _doPostBack in the attribute, you can identify the event in the pageLoad of your page, and so do what you want with your controls (dropdown and grid) which are controls "server," all right? This would be the quick solution, then identifying the click on pageLoad, just change the values. Dropdown.Selectedvalue = "0" and Datagrid.Datasource = New Datatable(0), for example.
An example of how to get the _doPostBack event from the controller you enabled in page_Load.
Dim eventTarget As String = IIf(Me.Request("__EVENTTARGET") = Nothing, String.Empty, Me.Request("__EVENTTARGET"))
'Evento de Pesquisa do botão ENCONTRAR
If eventTarget.Equals("ValorArgumento") Then
MetodoAção()
End If
In Html you will set the following:
<button onclick="__doPostBack('ValorArgumento', '')" id="idBotao" type="button"></button>
Now, if you want to do this with javascript, no post, you have to create a javascript function, find the elements (can be with jquery keys) and assign the property val() pro dropdown.
For lack of time I could not give an answer to your previous question, but follows a link that contains the answer to your question. http://stackoverflow.com/questions/3863927/lost-focus-method-for-asp-net-textbox
– Marciano.Andrade
I’ll try here, thanks @Marciano.Andrade
– AndreeH
@Andreeh That’s the same question you asked days ago, I think you better delete the other and keep this.
– Marconi
Beauty @Marconi. I still can’t solve ..
– AndreeH
@Andreeh has to be with the toogle function? I was thinking of doing the code bind.
– Marconi
Seguinte Andree, based on the answer there to use the method
__doPostBack('','')
in javascript, where this method is from the ajax of .net. Calling this method, a post back is executed and the method parameters are sent in the page_load event of your page.– Marciano.Andrade
in the page load you need to do the treatment of this postback, and that’s what the reply is referring to. That’s what you tried to do?
– Marciano.Andrade
That’s right, and it didn’t work ..
– AndreeH