Gentlemen,

Let me describe a scenario which seems to me a reproducible bug in VS.Net :

I am creating a ASP.Net web app in c#. In the aspx page ( or in ascx ), in
the design mode I add some kind of data bound server side control ( like a
datalist / datagrid ). Then use the templatecolumn for that data component
which is bound with a dataset. Now, while creating the itemtemplate, I need
to dynamically create the html ... so I have to use the DataBinder for that.
For example, below is a typical itemtemplate:


<ItemTemplate>
        <table>
        <tr>
        <td align="left" valign="center">
                <input type = "button" class ="stButton" value="Select"
language ="javascript" onclick = "SelectIt('<%#
DataBinder.Eval(Container.DataItem, "Login")%>','<%#
DataBinder.Eval(Container.DataItem, "FirstName")%> <%#
DataBinder.Eval(Container.DataItem, "LastName")%>' )"/>
        </td>
.... ( more similar items )
        </tr>
</table>
</ItemTemplate>

After I add this type of itemcolumn, and try to go back to design mode, I
can't ... it says
Could not open in Design View. Quote values differently inside a <% ... %>
block.
That was fine ... I can live with that, although now you have to write any
UI items in HTML view.
But now if you add any htmlelement ( like a hidden form variable ) and make
it runat server, and try to populate that from server side ( in the code
behind cs file ), it generates an error ( saying it can't find that element
in the namespace ). But if you switch to design view ( by temporarily
deleting the above Item Column ) and then again switch to html view and
recreate the Item Col, it starts recognizing the new html element which runs
at server.

This happens pretty consistently ... I happen to bump into this and found
the work around .. but just wanted to share with you guys and save some of
your head banging frustration ( which I had to do ). Also I would love to
know if I am missing something in this whole context ...

Thanks
Rahul

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to