How to pre-set combo textbox's selectedindex value from querystring passed
from another page?
I pass the querystring to set combo text box (change selectedindex on
Page_Init).
Source code as:
Protected Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Init
If Not (Page.IsPostBack) Then
If Not String.IsNullOrEmpty(Request.QueryString("RptType" )) Then
Dim rptType As String =
Request.QueryString("RptType").ToString
Select Case rptType
Case "Invoice"
ReportTypeCombo.SelectedIndex = 0
Session("RptType") = "Invoice"
Case "P.O."
ReportTypeCombo.SelectedIndex = 1
Session("RptType") = "P.O."
Case "Contract"
ReportTypeCombo.SelectedIndex = 2
Session("RptType") = "Contract"
End Select
End If
End If
End Sub
When I run it, it don't work. What is my wrong?