Hi
Could someone tell me why i cant set the value of Querystring variable "Month" on the Drop Down DDL_Month. I checked it on debuging mode and it gets the month number in the variable "Month" but it just never set the text on Drop Down (DDL_Month).
Many Thanks
Code:
If Page.IsPostBack = False Then
Dim iMonth As String = Request.QueryString("Month") ' ID.qs("Month")
Dim iYear As String = Request.QueryString("Year")
Dim iname As String = Request.QueryString("Category")
If iMonth <> "" And iYear <> "" And iname <> "" Then
Response.Write("Hello")
End If
If name <> "" Then
Dim Category As String = name
Category = Replace(Category, "-", " ")
If Request.QueryString("Year") <> "" Then
DDL_Year.Text = Request.QueryString("Year")
End If
If Request.QueryString("Month") <> "" Then
DDL_Month.Text = iMonth
End If
Dim dt As DataTable
Dim totalRecords As Integer
If Request.QueryString("Month") = "" Then
dt = BindGvData(CurrentPageNumber, 6, GetCategoryName(Category), 0, 0, totalRecords)
Else
dt = BindGvData(CurrentPageNumber, 6, GetCategoryName(iname), iYear, DDL_Month.SelectedValue, totalRecords)
End If
Dim i As Integer = totalRecords
GVListing.DataSource = dt
GVListing.DataBind()
Dim totalpages As Double
totalpages = totalRecords / 6
totalpages = System.Math.Ceiling(totalpages)
totalpages = Double.Parse(totalpages)
Total.Text = totalpages.ToString
Current.Text = CurrentPageNumber.ToString
If CInt(Total.Text) >= 1 Then
FirstPage.Enabled = True
PreviousPage.Enabled = True
NextPage.Enabled = True
LastPage.Enabled = True
If Current.Text <= 1 Then
FirstPage.Enabled = False
PreviousPage.Enabled = False
End If
ElseIf Total.Text <= 1 Then
FirstPage.Enabled = False
PreviousPage.Enabled = False
NextPage.Enabled = False
LastPage.Enabled = True
End If
NewsArchivePanel.Visible = True
Else
NewsArchivePanel.Visible = False
End If
Else
UpdateURL()
End If
Code:
<asp:DropDownList ID="DDL_Month" runat="server">
<asp:ListItem Text = "January" Value = "1" Selected =True ></asp:ListItem>
<asp:ListItem Text = "February" Value = "2"></asp:ListItem>
<asp:ListItem Text = "March" Value = "3"></asp:ListItem>
<asp:ListItem Text = "April" Value = "4"></asp:ListItem>
<asp:ListItem Text = "May" Value = "5"></asp:ListItem>
<asp:ListItem Text = "June" Value = "6"></asp:ListItem>
<asp:ListItem Text = "July" Value = "7"></asp:ListItem>
<asp:ListItem Text = "August" Value = "8"></asp:ListItem>
<asp:ListItem Text = "September" Value = "9"></asp:ListItem>
<asp:ListItem Text = "October" Value = "10"></asp:ListItem>
<asp:ListItem Text = "November" Value = "11"></asp:ListItem>
<asp:ListItem Text = "December" Value = "12"></asp:ListItem>
</asp:DropDownList>