954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem with ASP.Net control or JavaScript ???







Customer :

 


Department :




Kusno
Junior Poster
191 posts since Aug 2007
Reputation Points: 11
Solved Threads: 17
 

try to explain a litter further on what needs to be done. It was a bit confusing.. or if you could provide a link?

Also, in your javascript, you're not declaring where the form sits. Set a var = document.forms.form1 and then call it everytime you need it. So this means change your javascript code to:

<script language="Javascript" type="text/javascript">
function ChkAllCustomerClick()
{ 
var identity = document.forms.form1;
if(identity.ChkAllCustomer.checked == true)
{
identity.TxtCustomerId.value = "";
identity.TxtCustomerName.value = "";
identity.CmdLocateCustomer.disabled = true;
identity.CmbDept.disabled = false;
}
else
{ 
identity.CmdLocateCustomer.disabled = false;
identity.CmbDept.disabled = true;
}
}
</script>

As for the rest of your code, keep in mind that when it is rendered on page, the ID for that code is different then you chose for it to runat server. View Source on your browser after running the code. Try not to use runat server controls if you don't have to. HTML controls are faster and obviously don't use server resources. So for your cmdLocate button or whatever, make that an HTML button and disabled="disabled" value. This should solve your problem.

SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
 

CmdLocateCustomer is used to open popup window and send value to it parent page.

In ASP.Net :
Protected Sub CmdLocateCustomer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CmdLocateCustomer.Click
Dim S As String = PopUpWindow("w_customer", "../../Browse/LocateCustomerMaster.aspx?CustomerId=form1.TxtCustomerId&CustomerName=form1.TxtCustomerName", 880, 550)
If ClientScript.IsClientScriptBlockRegistered("w") = False Then
ClientScript.RegisterClientScriptBlock(Me.GetType(), "w", S)
End If
End Sub

In Javascript :
function CmdLocateCustomer_onclick() {
var w = window.open('"../../Browse/LocateCustomerMaster.aspx?CustomerId=form1.TxtCustomerId&CustomerName=form1.TxtCustomerName','window');
w.focus();
}

I can use one of both scripts. But at least, I want to know why that problem occours when I use ASP.Net control :icon_confused: .

Kusno
Junior Poster
191 posts since Aug 2007
Reputation Points: 11
Solved Threads: 17
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You