Ask a Question related to ASP.NET General, Design and Development.
-
renateves #1
Error getting values from a table created dynamic!
My problem is that i have a xml file that is convert into a table (by
xsl) in a
aspx file, and in vb code i want to get and put some values to the
table. Is the code:
ASPX FILE
<Get the table with the values from the xml file>
.....
<asp:Xml id="myXml" DocumentSource="XMLCat.xml"
TransformSource="Perf.xsl" runat="server"></asp:xml>
.....
XSL File
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/xsl/transform'>
<xsl:template match="/">
<style>
.value { width:"25%";font-family:courier new; font-size:.8em;
white-space=pre;}
</style>
<table border="1" cellspacing="0" cellpadding="3" id="tablexml">
<tr>
<th>id</th>
<th>text</th>
</tr>
<xsl:for-each select='treenodes/treenode'>
<tr>
<td class="value"><em><xsl:value-of
select='@id'/></em></td>
<td class="value"><xsl:value-of select='@text'/></td>
</tr>
<xsl:for-each select='treenode'>
<tr>
<td class="value"><em><xsl:value-of
select='@id'/></em></td>
<td class="value"><xsl:value-of select='@text'/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
VB FILE
.....
tc.Controls.Add(New LiteralControl(newID & "," & category))
tr.Cells.Add(tc)
tableXml.Rows.Add(tr)
.....
and the output error is:
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
Line 153: tc.Controls.Add(New LiteralControl(newID &
"," & category))
Line 154: tr.Cells.Add(tc)
Line 155: tableXml.Rows.Add(tr)
Line 156: Else
Source File: C:\Inetpub\DSL\Patrocinio.PT\PortalDSL\DesktopModu les\FAQ\AskManag.aspx.vb
Line: 155
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
ASPNetPortal.AskManag.insertNewNodIntoTable(String newID, String
category, String id) in
C:\Inetpub\DSL\Patrocinio.PT\PortalDSL\DesktopModu les\FAQ\AskManag.aspx.vb:155
ASPNetPortal.AskManag.cmd_AddCategory_Click(Object sender,
EventArgs e) in C:\Inetpub\DSL\Patrocinio.PT\PortalDSL\DesktopModu les\FAQ\AskManag.aspx.vb:64
System.Web.UI.WebControls.LinkButton.OnClick(Event Args e)
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()
Thanks for the help that can be give!
renateves Guest
-
saving text values of dynamically created textboxes
I have many textboxes that are created dynamically as child controls of my custom control. I know that I must recreate them after each postback... -
retrieving values from dynamically created controls
Hi, Someone please clear this for me! I display a bunch of button controls on a page dynamically, adding them to a placeholder control in my... -
when is the target table is created in an table event monitor
Hi Folks, Here is the question, In V8 an event monitor is created with the WRITE TO TABLE option. When are the target tables created? The event... -
help. null dynamic table results in error
When user input from form variables results in null dynamic tables (repeating regions), I get the following error message: "ADODB.Field... -
accessing values from checkbox created with ITemplate
hi folks, i have a checkbox in my datagrid created this way: http://www.superdotnet.com/show_article.aspx?pkID=116 with C# code-behind,...



Reply With Quote

