I am attempting my first asp.net/vb.net application.
I have 15 clinical programs that a user may be a member of.
When a row is selected in the gridview, I would like to get the value of the clinical program the employee is a member of.
I would then like to set what page url is used for the redirect.
I can not get the "myurlpath" field to be used as a url path.
The URL that is displayed is
The "important" lines of code are as follows:
The Grid:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px"
CellPadding="3" CellSpacing="1" DataSourceID="SqlDataSource1"
EnableModelValidation="True" GridLines="None"
onselectedindexchanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:TemplateField FooterText="0">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="myurlpath{16}&Review_ID{1}&Employee={2}&Program={5}&DateAssigned={6}&PRClientID={9}"
Text="Start Review"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ReviewID" HeaderText="ReviewID"
SortExpression="ReviewID" FooterText="1" />
<asp:BoundField DataField="Reviewer" HeaderText="Reviewer"
SortExpression="Reviewer" FooterText="2" />
<asp:BoundField DataField="Employee" HeaderText="Employee"
SortExpression="Employee" FooterText="3" />
<asp:BoundField DataField="DateComplete" HeaderText="DateComplete"
SortExpression="DateComplete" FooterText="4" />
<asp:BoundField DataField="AssignedBy" HeaderText="AssignedBy"
SortExpression="AssignedBy" FooterText="5" />
<asp:BoundField DataField="Program" HeaderText="Program"
SortExpression="Program" FooterText="6" />
<asp:BoundField DataField="DateAssigned" HeaderText="DateAssigned"
SortExpression="DateAssigned" FooterText="7" />
<asp:BoundField DataField="ReviewerEmail" HeaderText="ReviewerEmail"
SortExpression="ReviewerEmail" FooterText="8" />
<asp:BoundField DataField="SupervisorEmail" HeaderText="SupervisorEmail"
SortExpression="SupervisorEmail" FooterText="9" />
<asp:BoundField DataField="PRClientID" HeaderText="PRClientID"
SortExpression="PRClientID" FooterText="10" />
<asp:BoundField DataField="DateOfService" HeaderText="DateOfService"
SortExpression="DateOfService" FooterText="11" />
<asp:BoundField DataField="EditedBy1" HeaderText="EditedBy1"
SortExpression="EditedBy1" FooterText="12" />
<asp:BoundField DataField="EditedBy2" HeaderText="EditedBy2"
SortExpression="EditedBy2" FooterText="13" />
<asp:BoundField DataField="EditedBy3" HeaderText="EditedBy3"
SortExpression="EditedBy3" FooterText="14" />
<asp:BoundField DataField="EditedBy4" HeaderText="EditedBy4"
SortExpression="EditedBy4" FooterText="15" />
<asp:BoundField DataField="myurlpath" HeaderText="myurlpath"
SortExpression="myurlpath" FooterText="16" />
</Columns>
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStringsLCPeerRvwConnectionString %>"
SelectCommand="SELECT * FROM [AssignedReviews]"></asp:SqlDataSource>
</td>
The Code Behind: (myserver and myapplication have replace the true names of the server and application for demonstration purposes)
Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim MyProgram As String
MyProgram = "GridView1.SelectedRow.Cells[6].Text"
If MyProgram = "Physicians-Residential" Or MyProgram = "Physicians-Outpatient" Or MyProgram = "ARNP-Outpatient" Then
myurlpath = " ElseIf MyProgram = "Nurses-Residential" Then
myurlpath = " ElseIf MyProgram = "Nurses-Outpatient" Then
myurlpath = " ElseIf MyProgram = "Clinicians-ESAC" Or MyProgram = "Clinicians-Admission Services" Or MyProgram = "Clinicians-Outpatient" Or MyProgram = "Clinicians-Child Community Svcs(Wrap/BNet/TBOS)" Or MyProgram = "Clinicians-Drug Court/FIRST" Then
myurlpath = " ElseIf MyProgram = "BHT Crossroads-Residential" Or MyProgram = "BHT Crossroads-Detox" Then
myurlpath = " ElseIf MyProgram = "Case Managers-Forensics" Then
myurlpath = " ElseIf MyProgram = "Case Managers-Adult TCM" Or MyProgram = "Case Managers-Child TCM" Then
myurlpath = " End If
End Sub
My Errors:
Path displayed as URL:
Server Error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
I have 15 clinical programs that a user may be a member of.
When a row is selected in the gridview, I would like to get the value of the clinical program the employee is a member of.
I would then like to set what page url is used for the redirect.
I can not get the "myurlpath" field to be used as a url path.
The URL that is displayed is
The "important" lines of code are as follows:
The Grid:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px"
CellPadding="3" CellSpacing="1" DataSourceID="SqlDataSource1"
EnableModelValidation="True" GridLines="None"
onselectedindexchanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:TemplateField FooterText="0">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="myurlpath{16}&Review_ID{1}&Employee={2}&Program={5}&DateAssigned={6}&PRClientID={9}"
Text="Start Review"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ReviewID" HeaderText="ReviewID"
SortExpression="ReviewID" FooterText="1" />
<asp:BoundField DataField="Reviewer" HeaderText="Reviewer"
SortExpression="Reviewer" FooterText="2" />
<asp:BoundField DataField="Employee" HeaderText="Employee"
SortExpression="Employee" FooterText="3" />
<asp:BoundField DataField="DateComplete" HeaderText="DateComplete"
SortExpression="DateComplete" FooterText="4" />
<asp:BoundField DataField="AssignedBy" HeaderText="AssignedBy"
SortExpression="AssignedBy" FooterText="5" />
<asp:BoundField DataField="Program" HeaderText="Program"
SortExpression="Program" FooterText="6" />
<asp:BoundField DataField="DateAssigned" HeaderText="DateAssigned"
SortExpression="DateAssigned" FooterText="7" />
<asp:BoundField DataField="ReviewerEmail" HeaderText="ReviewerEmail"
SortExpression="ReviewerEmail" FooterText="8" />
<asp:BoundField DataField="SupervisorEmail" HeaderText="SupervisorEmail"
SortExpression="SupervisorEmail" FooterText="9" />
<asp:BoundField DataField="PRClientID" HeaderText="PRClientID"
SortExpression="PRClientID" FooterText="10" />
<asp:BoundField DataField="DateOfService" HeaderText="DateOfService"
SortExpression="DateOfService" FooterText="11" />
<asp:BoundField DataField="EditedBy1" HeaderText="EditedBy1"
SortExpression="EditedBy1" FooterText="12" />
<asp:BoundField DataField="EditedBy2" HeaderText="EditedBy2"
SortExpression="EditedBy2" FooterText="13" />
<asp:BoundField DataField="EditedBy3" HeaderText="EditedBy3"
SortExpression="EditedBy3" FooterText="14" />
<asp:BoundField DataField="EditedBy4" HeaderText="EditedBy4"
SortExpression="EditedBy4" FooterText="15" />
<asp:BoundField DataField="myurlpath" HeaderText="myurlpath"
SortExpression="myurlpath" FooterText="16" />
</Columns>
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStringsLCPeerRvwConnectionString %>"
SelectCommand="SELECT * FROM [AssignedReviews]"></asp:SqlDataSource>
</td>
The Code Behind: (myserver and myapplication have replace the true names of the server and application for demonstration purposes)
Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim MyProgram As String
MyProgram = "GridView1.SelectedRow.Cells[6].Text"
If MyProgram = "Physicians-Residential" Or MyProgram = "Physicians-Outpatient" Or MyProgram = "ARNP-Outpatient" Then
myurlpath = " ElseIf MyProgram = "Nurses-Residential" Then
myurlpath = " ElseIf MyProgram = "Nurses-Outpatient" Then
myurlpath = " ElseIf MyProgram = "Clinicians-ESAC" Or MyProgram = "Clinicians-Admission Services" Or MyProgram = "Clinicians-Outpatient" Or MyProgram = "Clinicians-Child Community Svcs(Wrap/BNet/TBOS)" Or MyProgram = "Clinicians-Drug Court/FIRST" Then
myurlpath = " ElseIf MyProgram = "BHT Crossroads-Residential" Or MyProgram = "BHT Crossroads-Detox" Then
myurlpath = " ElseIf MyProgram = "Case Managers-Forensics" Then
myurlpath = " ElseIf MyProgram = "Case Managers-Adult TCM" Or MyProgram = "Case Managers-Child TCM" Then
myurlpath = " End If
End Sub
My Errors:
Path displayed as URL:
Server Error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.