Hi ,
I am having a problem.
in my page i have a ModalPopupExtender in which i have a textbox.
when user click on new button.this modelpopextender open and textbox is focused.
I am using below code to do this.
mpeNewCompany.Show()
txtNewCompany.Focus()
Up to here..code is running fine.
Not i have another page and from that page i am navigating to this page which is having modelpopup.
i am checking on page load, if the page is redirecting from that page, then whithout clicking on new, i am prompting modelpopupextender.This is also working fine.
But i want when the model popup get open , the focus should be on textbox.This is not happening. I am using the same code for focus. Below is the code which i am calling at Page load.
Private Sub
CheckNewEdit()
Try
'If company Id is 0 then it is redirected to add new company
'otherwise this page has been redirected to edit records of existing company
If CompanyId = "0"
Then
ibtnPrint.Enabled =
False
ibtnReferesh.Enabled =
False
ibtnSave.Enabled =
False
cmdNew.Enabled =
True
If Not IsPostBack
Then
mpeNewCompany.Show()
txtNewCompany.Text =
""
lblNewError.Text =
""
txtNewCompany.Focus()
End
If
Else
ibtnPrint.Enabled =
True
ibtnReferesh.Enabled =
True
ibtnSave.Enabled =
True
cmdNew.Enabled =
True
End
If
Catch ex As
Exception
ShowError(
"An error occurred CheckNewEdit: "
& ex.Message)
End
Try
End
Sub
----------------------------------------
Please help.
Thanks in advance.
Saurabh