 |
| ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 15th, 2010, 07:38 PM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
how to put value into html button?
i trying to put a intger into
<%
Dim i As Integer
i = 5
%>
<input name="12" type=hidden value='<%# "i" %>' />
its not work,what should i do?
|
|

November 15th, 2010, 08:06 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
|
|
If all that code is in the ".aspx" file, then you should be able to just use
Code:
<input name="12" type="hidden" value="<%= i %>" />
Using a name for a form field that isn't a legal variable name is NOT a good idea. It can work, but it can cause problems.
|
|
The Following User Says Thank You to Old Pedant For This Useful Post:
|
|
|

November 16th, 2010, 01:33 AM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
thanks alot
|
|

November 16th, 2010, 05:17 PM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
do i know how to do this
Response.Write(<asp:Image ID="Image1" runat="server" ImageUrl="~/LOGO.jpg"/>)
?
|
|

November 16th, 2010, 05:47 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You can't do that. Response.Write writes to the output directly, so the control you try to declare is sent as-is, and is not processed at the server.
What exactly are you trying to accomplish?
Imar
|
|

November 16th, 2010, 06:15 PM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
i want something like a linkbutton.
its work when iwrite it HTML button but its not pretty.
Response.Write("<input type=""hidden"" name=""like"" value=""" & rc.Fields.Item(1).Value & """ /><input type=""submit"" value=""ממליץ"" style=""height: 23px; width: 45px; background-color: #FFFFFF; color: #FF0000"" >")
|
|

November 17th, 2010, 04:25 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Why not simply use a LinkButton? I don't see anything dynamic here that couldn't be accomplished through code or data binding. E.g.:
yourLinkButton.Text = SomeDynamicTextHere
The code snippet rc.Fields.Item(1).Value reminds me of classic ASP. It looks like you're using or upgrading classic ASP techniques here. Are you sure you're taking enough advantage of the new stuff in ASP.NET and not try to squeeze the classic ASP concepts in the new ASP.NET world?
Cheers,
Imar
|
|

November 17th, 2010, 05:22 AM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
i know the net version ,but i want to do it in classic way.
|
|

November 17th, 2010, 06:24 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
But why? There's just some stuf that can't be done the classic way in ASP.NET, such as Response writing a server control.
Cheers,
Imar
|
|

November 17th, 2010, 06:56 AM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
i can do it in repetar but in response.write i can play more and write better program.
|
|
 |