post back event for a button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here's the question:

I have a form w/ TextBox controls and a Search Button control. Once the user
clicks the Search Button, they get a Modal dialog w/ a datagrid that contains
their search results. They select a row and click OK. The return value of the
Module triggers an method that populates the TextBoxes w/ values and disables
them. After the TextBoxes are disabled, I change the text of the buton to
"Search Again" since I have to allow users to search again if they don't like
the selection.

I need to figure out how to enable the fields if the user clicks the button
again w/o opening the Modal again. Once the fields are enabled, I want to
allow the user to click the Search Button again and get the Modal window w/
their results...

Are there any thoughts on this subject?

Thanks for the advice,
Galahad
 
dear friend;
do you open the search result in a new page or what? if yes the textbox
search page is not posted back after the result comes up. and that means they
you have to repost back the page to enable the button and textbox.
or use java script to do such things!
 
Galahad,

I had the idea it was a windows form application, what is quiet default here
in the dotnet newsgroup except as it is a kind of webform newsgroup.

Because of the answer from Mos and the word "post back", I become unsure,
because the answers are a little bit different, can you tell us what it is.

Cor
 
Dear Cor;
i think it is a mistake from me, i did not understand the question in the
right way. there for i admit it is my mistake here :) thank you for your
attintion
 
It is a webform. The search result is opened in a new modal window. I have
no issue disabling the textbox after the user first choosing a selection.
However after that the user may want to search again so I have to figure out
a way for the user to click the Seach button again which would enable the
fields, BUT not open the modal again. The user would then input text and
click Search. Upon click event the modal window would open again. It is kinda
a weird requirement I know...

If you have any thoughts on maybe a better way to do this functionality
maybe w/a reset button, please let me know...thanks
 
Galahad,

Sorry that I have to ask than more, what is than a modal window. I assume
that you open an extra webpage. (And than it is important how AFAIK do you
have in ASPNET only have pages, not modal windows or it should be the html
"prompt").

Cor
 
Yes a webform is opened in a new window. It is opened with Javascript:
window.showModalDialog. A modal window is simply a dialog box such as you
would see when you print a document or things of that nature
 
Galahad,

The only thing that I know that will function in this with ASPNET is this.

Not that there are no alternatives but than I don't know them.

\\\\
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim str As String
If Not IsPostBack Then
TextBox1.ForeColor = Color.White
TextBox1.BorderStyle = BorderStyle.None
Dim alertScript As String = _
"<script language=JavaScript>document.all.item('TextBox1').value
" & _
" = prompt('Give me text','My name is nobody'); </script>"
RegisterStartupScript("Startup", alertScript)
Else
str = TextBox1.Text
End If
End Sub
///

I hope this helps a little bit?

Cor
 
Back
Top