Advertisement

09.25.2008 at 02:25PM PDT, ID: 23764367
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Error/No Response in calling javascript function at OnClientClick event for asp button

Asked by abhiR in Active Server Pages (ASP), .NET, Microsoft Visual Basic.Net

Tags: , ,

In my VB code I get an error message when I call a VB procedure from OnclientClick event of asp button.

-> I tried an alternate option of using a JavaScript function but IE and FireFox behaved differently to that:

a) IE : successful execution

b) FireFox: No Reponse


Q1: Could you help me with why I get the error "<procedure-name> is undefined" on calling VB procedure at OnClientCLick event for the ASP button.

Q2: And why does FireFox not respond to the JavaScript Function call.

Please Find the Code Snippet below___________________

A) VB & JavaScript Code

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">

 <script LANGUAGE="JavaScript" type="text/javascript">
    function testResults(form) {
    var strTitle = document.getElementById('TextBox0').value
    var strSponsor = document.getElementById('TextBox3').value
    //document.getElementById('TextBox1').value  = strTitle
    //document.getElementById('TextBox2').value  = strSponsor
    //Response.Redirect("StudyInterfaceAdvancedSearch.asp.aspx")
    window.location.replace("http://160.94.85.5:3514/Website2/Test-StudyInterfaceAdvancedSearch-List.asp.aspx?strTitle=" + strTitle + "&strSponsor=" +strSponsor);
}
 </script>  
 
  <script language="VB" runat="server">
 
     Sub redirect(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
         
         Dim strTitle As String = TextBox0.Text
         Dim strSponsor As String = TextBox3.Text
         Response.Redirect("http://160.94.85.5:3514/Website2/Test-StudyInterfaceAdvancedSearch-List.asp.aspx?strTitle=" + strTitle + "&strSponsor=" + strSponsor)
     End Sub
     
     Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
         
     End Sub
 </script>

    <title>Database Connection</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />

</head>

B) ASP button parameters used for calling Javascript function and VB procedure are below

-For Javascript function: testResults

      <asp:Button ID="Button1" runat="server"  Text="Search" Width="200px" OnClientClick="javascript:testResults();" />

-For VB procedure redirect

<asp:Button ID="Button1" runat="server"  Text="Search" Width="200px" OnClientClick="redirect" />


Start Free Trial
[+][-]09.25.2008 at 04:13PM PDT, ID: 22574898

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), .NET, Microsoft Visual Basic.Net
Tags: VB .Net, VB .NET, FireFox/ IE
Sign Up Now!
Solution Provided By: Morcalavin
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20081112-EE-VQP-44 - Hierarchy / EE_QW_2_20070628