LinkButton Problem

Discussion in 'ASP .Net' started by Mike, Feb 27, 2004.

  1. Mike

    Mike Guest

    Hello,

    I am using dynamically created LinkButtons. When I run the project I get an error message saying "Line: 114, Char: 33, Error: Expected ";", Code: 0......."

    The code I am using to create these LinkButtons is:

    Dim obj As New LinkButton

    obj.Text = "<br>" + a.Description + "<br>"

    Me.ucTemplate.addHyperlinkToActivities(obj)

    .............

    .............

    Me.Placeholder1.Controls.Add(obj)



    I am also building "Labels" and "Buttons", but am not having the aforementioned error message. Any idea?

    Thanks
    Michael
    Mike, Feb 27, 2004
    #1
    1. Advertising

  2. Mike

    Rajiv R Guest

    Hi,

    Which of them is line 114?

    --
    Cheers!
    Rajiv. R
    Rajspace.Org

    "Mike" <> wrote in message news:uDkm24M$...

    Hello,

    I am using dynamically created LinkButtons. When I run the project I get an error message saying "Line: 114, Char: 33, Error: Expected ";", Code: 0......."

    The code I am using to create these LinkButtons is:

    Dim obj As New LinkButton

    obj.Text = "<br>" + a.Description + "<br>"

    Me.ucTemplate.addHyperlinkToActivities(obj)

    ............

    ............

    Me.Placeholder1.Controls.Add(obj)



    I am also building "Labels" and "Buttons", but am not having the aforementioned error message. Any idea?

    Thanks
    Michael
    Rajiv R, Feb 27, 2004
    #2
    1. Advertising

  3. Mike

    Mike Guest

    Rajiv,

    By looking at the generated web site code, I found the following:

    101 <form name="ucTemplate:ActivitiesForm" method="post" action="Main.aspx" id="ucTemplate_ActivitiesForm">
    102 <input type="hidden" name="__EVENTTARGET" value="" />
    103 <input type="hidden" name="__EVENTARGUMENT" value="" />
    104 <input type="hidden" name="__VIEWSTATE" value="dDwtMTcyODI2MjY1Njs7Phc6Js6mah4QCazl6vSZtpdXScGu" />
    105
    106 <script language="javascript">
    107 <!--
    108 function __doPostBack(eventTarget, eventArgument) {
    109 var theform;
    110 if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
    111 theform = document.forms["ucTemplate:ActivitiesForm"];
    112 }
    113 else {
    114 theform = document.ucTemplate:ActivitiesForm;
    115 }
    116 theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    117 theform.__EVENTARGUMENT.value = eventArgument;
    118 theform.submit();
    119 }
    120 // -->
    121 </script>

    But I am not sure whether the source code is correctly generated, since I get the error message I described earlier.

    Any idea?


    --
    Michael


    "Rajiv R" <> wrote in message news:%23Pm5y7R$...
    Hi,

    Which of them is line 114?

    --
    Cheers!
    Rajiv. R
    Rajspace.Org

    "Mike" <> wrote in message news:uDkm24M$...

    Hello,

    I am using dynamically created LinkButtons. When I run the project I get an error message saying "Line: 114, Char: 33, Error: Expected ";", Code: 0......."

    The code I am using to create these LinkButtons is:

    Dim obj As New LinkButton

    obj.Text = "<br>" + a.Description + "<br>"

    Me.ucTemplate.addHyperlinkToActivities(obj)

    ............

    ............

    Me.Placeholder1.Controls.Add(obj)



    I am also building "Labels" and "Buttons", but am not having the aforementioned error message. Any idea?

    Thanks
    Michael
    Mike, Feb 27, 2004
    #3
  4. Mike

    Mike Guest

    Rajiv,

    I looked at the source code again and apparently found the problem. Line 114 should be:

    theform = document.forms["ucTemplate:ActivitiesForm"];

    The problem is that this line of code is automatically generated by Visual Studio. Any idea on how I could fix the problem?

    Thanks.
    Mike


    "Mike" <> wrote in message news:%23pWYh$R$...

    Rajiv,

    By looking at the generated web site code, I found the following:

    101 <form name="ucTemplate:ActivitiesForm" method="post" action="Main.aspx" id="ucTemplate_ActivitiesForm">
    102 <input type="hidden" name="__EVENTTARGET" value="" />
    103 <input type="hidden" name="__EVENTARGUMENT" value="" />
    104 <input type="hidden" name="__VIEWSTATE" value="dDwtMTcyODI2MjY1Njs7Phc6Js6mah4QCazl6vSZtpdXScGu" />
    105
    106 <script language="javascript">
    107 <!--
    108 function __doPostBack(eventTarget, eventArgument) {
    109 var theform;
    110 if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
    111 theform = document.forms["ucTemplate:ActivitiesForm"];
    112 }
    113 else {
    114 theform = document.ucTemplate:ActivitiesForm;
    115 }
    116 theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    117 theform.__EVENTARGUMENT.value = eventArgument;
    118 theform.submit();
    119 }
    120 // -->
    121 </script>

    But I am not sure whether the source code is correctly generated, since I get the error message I described earlier.

    Any idea?


    --
    Michael


    "Rajiv R" <> wrote in message news:%23Pm5y7R$...
    Hi,

    Which of them is line 114?

    --
    Cheers!
    Rajiv. R
    Rajspace.Org

    "Mike" <> wrote in message news:uDkm24M$...

    Hello,

    I am using dynamically created LinkButtons. When I run the project I get an error message saying "Line: 114, Char: 33, Error: Expected ";", Code: 0......."

    The code I am using to create these LinkButtons is:

    Dim obj As New LinkButton

    obj.Text = "<br>" + a.Description + "<br>"

    Me.ucTemplate.addHyperlinkToActivities(obj)

    ............

    ............

    Me.Placeholder1.Controls.Add(obj)



    I am also building "Labels" and "Buttons", but am not having the aforementioned error message. Any idea?

    Thanks
    Michael
    Mike, Feb 27, 2004
    #4
  5. Mike

    Mike Guest

    I found the solution. I had to include all the HTML code in a <form>...</form> tag. I initially only included the part in which LinkButtons were created.

    Wondering if this is correct...

    Mike


    "Mike" <> wrote in message news:eAT$7MS$...

    Rajiv,

    I looked at the source code again and apparently found the problem. Line 114 should be:

    theform = document.forms["ucTemplate:ActivitiesForm"];

    The problem is that this line of code is automatically generated by Visual Studio. Any idea on how I could fix the problem?

    Thanks.
    Mike


    "Mike" <> wrote in message news:%23pWYh$R$...

    Rajiv,

    By looking at the generated web site code, I found the following:

    101 <form name="ucTemplate:ActivitiesForm" method="post" action="Main.aspx" id="ucTemplate_ActivitiesForm">
    102 <input type="hidden" name="__EVENTTARGET" value="" />
    103 <input type="hidden" name="__EVENTARGUMENT" value="" />
    104 <input type="hidden" name="__VIEWSTATE" value="dDwtMTcyODI2MjY1Njs7Phc6Js6mah4QCazl6vSZtpdXScGu" />
    105
    106 <script language="javascript">
    107 <!--
    108 function __doPostBack(eventTarget, eventArgument) {
    109 var theform;
    110 if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
    111 theform = document.forms["ucTemplate:ActivitiesForm"];
    112 }
    113 else {
    114 theform = document.ucTemplate:ActivitiesForm;
    115 }
    116 theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    117 theform.__EVENTARGUMENT.value = eventArgument;
    118 theform.submit();
    119 }
    120 // -->
    121 </script>

    But I am not sure whether the source code is correctly generated, since I get the error message I described earlier.

    Any idea?


    --
    Michael


    "Rajiv R" <> wrote in message news:%23Pm5y7R$...
    Hi,

    Which of them is line 114?

    --
    Cheers!
    Rajiv. R
    Rajspace.Org

    "Mike" <> wrote in message news:uDkm24M$...

    Hello,

    I am using dynamically created LinkButtons. When I run the project I get an error message saying "Line: 114, Char: 33, Error: Expected ";", Code: 0......."

    The code I am using to create these LinkButtons is:

    Dim obj As New LinkButton

    obj.Text = "<br>" + a.Description + "<br>"

    Me.ucTemplate.addHyperlinkToActivities(obj)

    ............

    ............

    Me.Placeholder1.Controls.Add(obj)



    I am also building "Labels" and "Buttons", but am not having the aforementioned error message. Any idea?

    Thanks
    Michael
    Mike, Feb 27, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Meade

    LinkButton / doPostBack problem

    Rob Meade, Aug 25, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,041
    Raterus
    Aug 25, 2004
  2. Henri
    Replies:
    2
    Views:
    733
    Henri
    Oct 5, 2004
  3. =?Utf-8?B?TWFubnkgQ2hvaGFu?=

    Problem with controlling visibility of linkbutton

    =?Utf-8?B?TWFubnkgQ2hvaGFu?=, Apr 5, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    423
    Eliyahu Goldin
    Apr 5, 2005
  4. Sathyaish
    Replies:
    3
    Views:
    3,097
    Sathyaish
    Sep 8, 2005
  5. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    180
    Sathyaish
    Sep 8, 2005
Loading...

Share This Page