LinkButton Problem

M

Mike

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
 
R

Rajiv R

Hi,

Which of them is line 114?

--
Cheers!
Rajiv. R
Rajspace.Org


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
 
M

Mike

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


Hi,

Which of them is line 114?

--
Cheers!
Rajiv. R
Rajspace.Org


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
 
M

Mike

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



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


Hi,

Which of them is line 114?

--
Cheers!
Rajiv. R
Rajspace.Org


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
 
M

Mike

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



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



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


Hi,

Which of them is line 114?

--
Cheers!
Rajiv. R
Rajspace.Org


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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top