|
<b>I fixed this problem and it's not longer an issue.</b>
I renamed the PageHTML literal to Literal1 and it works. I haven't researched it but my gut
feeling tells me I'm using the PageHTML literal in the master page this page derives from
and that's a problem I'd guess.
Anybody see what I'm doing wrong with my asp:Literal "PageHTML"? Oddly enought "CommentsHTML" shows up fine. But PageHTML is always blank. Another odd one is that I can put any text I want after the closing literal tag for PageHTML and that text appears fine. So it must be something inside the PageHTML from the DB but what?
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div>
<br />
<table align="left" style="width: 448px; position: relative; top: -19px; height: 320px">
<tr>
<td rowspan="2" style="width: 179px; height: 237px" valign="top">
<asp:Image ID="Image1" runat="server" Height="228px" Style="position: relative" Width="172px" /></td>
<td align="left" rowspan="2" style="height: 237px" valign="top">
<asp:Literal ID="PageHTML" runat="server" /></td>
</tr>
<tr>
</tr>
<tr>
<td colspan="2" style="height: 21px">
<asp:Literal ID="CommentsHTML" runat="server" /></td>
</tr>
</table>
</div>
</asp:Content>
Here's the contents I'm passing into PageHTML:
<p><font face="Arial, Helvetica, sans-serif" size="2"><strong>Mrs. Jane Wilson<br />
</strong>Mrs. Wilson has been at Bishop Kelly for 29 years. Ms. Wilson is a member of the Art Department.</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="2"><strong>Email</strong><br />
<a href="mailto:jwilson@bk.org">jwilson@bk.org</a></font></p>
<p><font face="Arial, Helvetica, sans-serif" size="2"><strong>Education </strong><br />
Bachelor's in Art Education from Washington State University.<br />
Master's in Art Education from Boise State University.</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="2"><strong>Class Schedule</strong></font></p>
<ol>
<li><font face="Arial, Helvetica, sans-serif" size="2">Art/Painting</font> </li>
<li><font face="Arial, Helvetica, sans-serif" size="2">Pottery</font> </li>
<li><font face="Arial, Helvetica, sans-serif" size="2">Pottery</font> </li>
<li><font face="Arial, Helvetica, sans-serif" size="2">Prep</font> </li>
<li><font face="Arial, Helvetica, sans-serif" size="2">Pottery</font> </li>
<li><font face="Arial, Helvetica, sans-serif" size="2">Pottery</font> </li>
<li><font face="Arial, Helvetica, sans-serif" size="2">Advanced Placement</font> </li>
</ol>
<p><font face="Arial, Helvetica, sans-serif" size="2"><strong>Clubs/Programs</strong></font></p>
<ul>
<li><font face="Arial, Helvetica, sans-serif" size="2">Art Club</font> </li>
</ul>
-- modified at 16:33 Wednesday 20th December, 2006
|
|
|
|
|
Now if I replace all the HTML in the DB with plain text "Plain text." it still won't show. But if I type "Plain text." after the closing literal it shows right up? So I guess it's something in my ContentPlaceHolder HTML...
|
|
|
|
|
Hi Rex,
You can view source the web page and see if the text stored in DB is brought back to the client side from the server?
|
|
|
|
|
I modified my first post that I figured this out but because I disabled HTML in it it's hard to spot. Have a look at the very top of my first post and tell me if my conclusion makes sense. I'm thinking the fact I was using an ASP:LITERAL of the same name in the master page was the problem. I renamed the literal after I realized this and it seemed to fix things.
|
|
|
|
|
In fact, you're still able to use the literal control on the content page with the id "PageHTML" even you already define another "PageHTML" literal on the master page. That's because they are in the different naming containers, so the UniqueID values of the two controls are different and you basically no need to worry about the name conflict. What I'm thinking is that you might have set the text to another literal control on the content page and this control is not in the page's control hierarchy, as a result of that the text is not rendered to the client side.
|
|
|
|
|
I'm working on a faq/help page for an online application, and I bound an XmlDataSource to a treeview to simplify future revisions of the questions. It's pretty simple. The code is simply:
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="AppHelpXmlDataSource" ImageSet="Faq" ShowLines="True" ExpandDepth="1">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="Purple" />
<SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="DarkBlue" HorizontalPadding="5px"
NodeSpacing="0px" VerticalPadding="0px" />
<DataBindings>
<asp:TreeNodeBinding DataMember="apphelp_questions" TextField="TEXT"/>
<asp:TreeNodeBinding DataMember="question" TextField="TEXT" />
<asp:TreeNodeBinding DataMember="answer" TextField="TEXT" />
</DataBindings>
</asp:TreeView>
<asp:XmlDataSource ID="AppHelpXmlDataSource" runat="server" DataFile="~/applicationhelp/questions.xml">
</asp:XmlDataSource>
---------------
And the XML File looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<apphelp_questions TEXT="Please select your question:">
<question TEXT="How do I do this?">
<answer TEXT="This is how you do this."></answer>
</question>
</apphelp_questions>
---------------
This renders a nice treeview, but I don't want the users to be able to collapse the root node. I want it to display the "Please select your question:" text, and the text of the questions, and allow the user to expand the answers to each question. Is there any way to do this without hardcoding the root node text in the aspx file?
|
|
|
|
|
I have a gridview with a link in the parent page.when i click on the link it opens up another gridview.this child gridview has 2 columns,one is a checkbox created using an itemtemplate and another a boundfield retreiving data from the database.what i want is when i check the checkbox of a particular row and hit a button,the data existing in that particular row of the child gridview which has been checked,has to transfer the data from that row to the parent gridview,in a sense the parent gridview has to refresh and show up with the new data that has come from the child gridview control.How can i do this?..........urgent..........
hi
|
|
|
|
|
hi,
I want to pass some text data to FLASH from ASP.NET and I dont know how to emit simple and plain text from ASP.NET page rather than emitting a whole HTML page. My programming language is C#.NET 2.0
I appreciate your co-operation.
Thanks and regards
Emran
|
|
|
|
|
You can create a new WebForm completely free of markup, then override it's Render method:
protected override void Render(HtmlTextWriter writer)<br />
{<br />
writer.Write("This is the only content I want to emit to the browser.");<br />
}
|
|
|
|
|
Hi, Thanks and I appreciate your response.
Regards
Emran
|
|
|
|
|
Hello.
I need to create application using VB.NET that will parse csv file and import data into the database. I tried to read csv file but it returns funky characters. Did anyone had experience with this.
Thanks in advance.
Alex.
|
|
|
|
|
if you are using sql server it is so much easier to create a dts package, use the vb.net app to save the .csv file to the proper location then call the dts package from you app.
Other wise check here for a C# example that you can convert to vb.net.
|
|
|
|
|
Hi Everyone:
I have a unique requirement. I need to display data in a gridview and be able to add, edit or delete records from a web page using the gridview control.
The web control "FormView" will do all the operations, but it only shows one record at a time. The Gridview control shows all the records and will allow the user the ability to edit and delete records, but not add new ones.
Does anyone know how to combine the viewing capibilities of a gridvierw control and the record operations of the FormView into a single control?
Thanks in advance,
Mark McCumber
|
|
|
|
|
Mark, I have never used the "FormView" control. What I have done in the past is to store my gridview data as a DataTable serialized in ViewState. Then I give the user the option to add a new record and then add a new row to the datatable retreived from Viewstate and rebind it to the grid view.
|
|
|
|
|
The FormView control will automatically add a new record to a SQL database if you have the sqldatasource control configured to allow edits, deletes and inserts.
The formview control was built for data entry, but it would not show all the records like a gridview. My IT manager wants the form to look something like an Excel spread sheet, but have the fields in columnar form so the person entering the data can't make mistakes.
Thanks,
Mark McCumber
|
|
|
|
|
Oh well, I tried. It looks like you might have to do some programming instead of just relying on .net webcontrols.
|
|
|
|
|
I was afraid of that . I'm trying to create a Web based application that behaves like a Windows application. One that has a form and as you click the next button the data in the form changes.
Nothing is ever easy. I have always wondered why they call it "Rapid Development" when you still have to create code to do the required tasks.
Mark McCumber
|
|
|
|
|
Hi, I want to fill a datagrid from an ms access and i want to fill the datagrid in an ascending order. I want the last row of the database to be viewed in the first row of the datagrid. how can i do that? I have an autonumber as a primary key so that can give me some chance to make this happen. but how pls??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
If you are using a datatable, you can sort those.
Dataview dv = new Dataview(DataTable);
dv.sort = "AutoId desc";
DataTable = dv.toTable();
datagrid.datasource = DataTable;
datagrid.databind();
|
|
|
|
|
i am not using any data table. How can you use the Order by Asc?
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
You have to use DataView to enable the sorting
just insert that table in dataview and call the sort property by giving the column name and ASC or DESC
example
dataView1.Sort = "Country DESC";
Happy Coding
Best Regards,
Haissam Abdul Malak
My Blog
|
|
|
|
|
I have a gridview which contains columns retreived from the database.i have in total 12 columns,in which 4 columns have checkbox's where ever there is a null in the database.i have done tht on the rowdatabound event of gridview dynamically by calling
CheckBox cb= new CheckBox();
i also have a checkbox in the first column of the gridview created using an itemTemplate tag of gridview,so tht when we check the corresponding row's checkbox,the values in tht row shall be updated
now my question is,i want to check the boxes in the column cells and update those corresponding row values in the database on button click.and also i need the checkbox state to be maintained.......how can i do this?any responses will be appreciated.
hi
|
|
|
|
|
To make this just a bit easier. Create a template column in your gridview. Hide the checkboxe in the itembound event when the database value is null. That solves the problem of maintaining the viewstate of the grid.
Now to loop through your gridview. Here is some sample code to put behind your button (or during any event really).
CheckBox cb;
foreach (GridViewRow r in this.GridView1.Rows)
{
cb = (CheckBox)r.FindControl("cbUpdate");
if (cb.Checked)
{
//put code to update database
}
}
|
|
|
|
|
Thanks for the reply.but it has not solved my problem completely.i have done similar to what u have replied,but in my case i need to loop through the inner cells of the gridview and as well the rows and check if there is a checkbox at any cell in the gridview,if exists,based upon my requirement i have to click the checkbox in those cells and also check the checkbox in the first column,and then update.what i want is to check the checkbox in the gridview cells and also the checkbox field created using the itemtemplate in the gridview.when i check the cells with checkboxes and then check the checkbox that is existing in the first column of the gridview and click the update button,then the data in the corresponding row should update.....
hi
|
|
|
|
|
srishree wrote: Thanks for the reply.but it has not solved my problem completely.i have done similar to what u have replied,but in my case i need to loop through the inner cells of the gridview and as well the rows and check if there is a checkbox at any cell in the gridview,if exists,based upon my requirement i have to click the checkbox in those cells and also check the checkbox in the first column,and then update.what i want is to check the checkbox in the gridview cells and also the checkbox field created using the itemtemplate in the gridview.when i check the cells with checkboxes and then check the checkbox that is existing in the first column of the gridview and click the update button,then the data in the corresponding row should update.....
Do you have a question?
|
|
|
|