mark,
error is:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
Line 82:
Line 83: While
dtrPermissionReader.Read()
Line 84:
cboPermissions.Items.Add(New
ListItem(dtrPermissionReader("PermissionLevel"),
dtrPermissionReader("PermissionLevelID")))
Line 85: End While
Line 86:
Source File: C:\Inetpub\wwwroot\FireMaps\backend\user.aspx.vb Line:
84
source is:
<asp:DataGrid ID="dgAvailTools" Runat="server"
AutoGenerateColumns="False" AlternatingItemStyle-BackColor="#e5e5e5">
<AlternatingItemStyle BackColor="#E5E5E5"></AlternatingItemStyle>
<Columns>
<asp:BoundColumn DataField="ToolAlias" HeaderText="Tool Name">
<HeaderStyle CssClass="standardBold"></HeaderStyle>
<ItemStyle CssClass="standard"></ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="Permission">
<HeaderStyle CssClass="standardBold"></HeaderStyle>
<EditItemTemplate>
<asp:DropDownList ID=cboPermissions
Runat=server></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
code behind:
sSQL = "SELECT lnkTool.ToolName, lnkTool.ToolID, lnkTool.ToolAlias FROM
lnkTool WHERE ShowOnNav > 0 AND SecurityLevelID >= " &
Session("SecurityLevelID") & " ORDER BY ToolCategoryID, ToolName"
dtrToolReader = LoadReader(sSQL, oConn)
dgAvailTools.DataSource = dtrToolReader
dgAvailTools.DataBind()
sSQL = "SELECT
lkpPermissionLevel.PermissionLevelID,lkpPermissionLevel.PermissionLevel
FROM lkpPermissionLevel ORDER BY lkpPermissionLevel.PermissionLevelID"
dtrPermissionReader = LoadReader(sSQL, oConn)
While dtrPermissionReader.Read()
cboPermissions.Items.Add(New
ListItem(dtrPermissionReader("PermissionLevel"),
dtrPermissionReader("PermissionLevelID")))
End While
>>> [EMAIL PROTECTED] 06/21/2004 9:33:32 AM >>>
David,
1) What error are you getting? Post your code so we may help.
2) You will get whatever value is in the dorpdownlist upon submit. Use
dropdownlist.SelectedValue to get the unique ID of your tool/permission.
This would be set when the page loads.
Mark
denkide <[EMAIL PROTECTED]> wrote:
hello.
what i am trying to do is create a list of tools in a datagrid with
the tool permissions next to each tool in a drop down list.
the tools are coming from a table of available tools.
the permissions are coming from a table of available permissions.
ie:
tool 1 no access
create
edit
view
tool 2 no access
create
edit
view
i am having two issues:
1). i get an error when i try to nest a drop down list in the
EditItemTemplate for the datagrid.
2). how will i determine the tool/permission association on submit?
(ie: i would normally - ASP3.0 - name the drop down to have an
indicator in the name for which item it is that was selected)
so, am i using the correct control?
does anyone have a link/any info that could point me in the correct
direction?
nested data is the part of ASP.NET that is still a little difficult
to grasp. :)
thanks,
david
Yahoo! Groups SponsorADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
Yahoo! Groups SponsorADVERTISEMENT
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/