I am having the following issue.
I have an AJAX enabled Web Application in C#.
I am using a Master Page and then I have a Default.aspx page which is based on the Master page.
In my Default.aspx page I am using a ModalPopUpExtender control which I have declared in teh following way:
Expand|Select|Wrap|Line Numbers
- <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
- PopupControlID="Panel1"
- TargetControlID="Button1"
- BackgroundCssClass="modalBackground"
- OkControlID="OkButton"
- OnOkScript="onOk()"
- CancelControlID="CancelButton"
- DropShadow="true"/>
I need this to show when the page loads so I have the following code in my .cs file
Expand|Select|Wrap|Line Numbers
- protected void Page_LoadComplete(object sender, EventArgs e)
- {
- ModalPopupExtender1.Show(); //show the dialog box in which trhe user needs to enter their user name and password
- }
And here is the issue:
When the user clicks on the OK button I need to access a database and check to see if the spcified user exists in a Users Table.
I know how to do all that....BUT
I have the following routine in my Default.cs file and I though pressing on teh OK button will bring me to that routine
Expand|Select|Wrap|Line Numbers
- protected void OkButton_Click(object sender, EventArgs e)
- {
- //here is where I am planning to do the Database checking stuff
- }
I put a break point at the beginning of the routine but unfortunately when I press the OK button the code does not go there.
If you n otice however in my declaration of the ModalPopUpExtender I have the following
OnOkScript="onOk()"
so I have no problem acceessing the js function wen I click om the OK button.
The question is however how can I get to any function and aceess the database when I click on the OK button.
All I want to do is when the user clicks OK I want to access a table in the database and check against it.
If this can be done in js then great but I don't know how to do it, otehrwise how can I access a functio in my C# code taht can do the same thing.
Thanks very much
Susan