Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 18, 2010 08:37 AM by andrewjboyd
Contributor
4426 Points
864 Posts
Aug 17, 2010 06:25 AM|LINK
As ignatandrei asked, is it coming through into the HTML output?
Member
442 Points
405 Posts
Aug 18, 2010 12:24 AM|LINK
Yes, when I use for testing:
<input type="submit" name="testReportTitle" value= <%: Model.Report.Title %> />
The button only showed the words before space.
Aug 18, 2010 02:54 AM|LINK
That should be
<input type="submit" name="testReportTitle" value="<%: Model.Report.Title %>" />
I think it's as simple as you haven't put quotes around your value property
Aug 18, 2010 05:53 AM|LINK
WOW, yes, that's the problem.
Thanks
I don't quite understand why I need the double quotes?
<%: Model.Report.Title %> is already a string.
Aug 18, 2010 05:59 AM|LINK
Just more:
Why it works?
<select name="NameDropDown">
<% foreach(var nameObject in Model.NameList)
{ %>
<option value = <%: nameObject.NameCode %> > <%: nameObject.Fullname %> </option>
<% }
%>
</select>
Aug 18, 2010 08:37 AM|LINK
Because it's a property of your tag, there needs to be a defined beginning and end, without quotes it just views the first word as your property value
In terms of
The same logic applies to the value property, but the nameObject.Fullname doesn't require quotes because it's between two tags :)
andrewjboyd
Contributor
4426 Points
864 Posts
Re: Pass model to view - List<...> truncated after space
Aug 17, 2010 06:25 AM|LINK
As ignatandrei asked, is it coming through into the HTML output?
================================================
Why catch a fish to feed someone, when you can teach them to fish and they can feed themselves
AlanT
Member
442 Points
405 Posts
Re: Pass model to view - List<...> truncated after space
Aug 18, 2010 12:24 AM|LINK
Yes, when I use for testing:
<input type="submit" name="testReportTitle" value= <%: Model.Report.Title %> />
The button only showed the words before space.
andrewjboyd
Contributor
4426 Points
864 Posts
Re: Pass model to view - List<...> truncated after space
Aug 18, 2010 02:54 AM|LINK
That should be
<input type="submit" name="testReportTitle" value="<%: Model.Report.Title %>" />
I think it's as simple as you haven't put quotes around your value property
================================================
Why catch a fish to feed someone, when you can teach them to fish and they can feed themselves
AlanT
Member
442 Points
405 Posts
Re: Pass model to view - List<...> truncated after space
Aug 18, 2010 05:53 AM|LINK
WOW, yes, that's the problem.
Thanks
I don't quite understand why I need the double quotes?
<%: Model.Report.Title %> is already a string.
AlanT
Member
442 Points
405 Posts
Re: Pass model to view - List<...> truncated after space
Aug 18, 2010 05:59 AM|LINK
Just more:
Why it works?
<select name="NameDropDown">
<% foreach(var nameObject in Model.NameList)
{ %>
<option value = <%: nameObject.NameCode %> > <%: nameObject.Fullname %> </option>
<% }
%>
</select>
andrewjboyd
Contributor
4426 Points
864 Posts
Re: Pass model to view - List<...> truncated after space
Aug 18, 2010 08:37 AM|LINK
Because it's a property of your tag, there needs to be a defined beginning and end, without quotes it just views the first word as your property value
In terms of
<select name="NameDropDown">
<% foreach(var nameObject in Model.NameList)
{ %>
<option value = <%: nameObject.NameCode %> > <%: nameObject.Fullname %> </option>
<% }
%>
The same logic applies to the value property, but the nameObject.Fullname doesn't require quotes because it's between two tags :)
================================================
Why catch a fish to feed someone, when you can teach them to fish and they can feed themselves