code behind issue

code behind issue

am 01.02.2008 07:54:20 von solutionsdxb

Hi ,

I am using a code behind for asp.net page ,

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>

and file default.aspx.vb contains all the code including

Sub Page_Load()

If Request.QueryString("check") = "p" Then
'1. Create a connection

Dim tempemail As String
tempemail = User.Identity.Name
Me.rptrExample.EnableViewState = "True"
Me.rptrExample.Visible = "True"

Dim objConn As New
Data.SqlClient.SqlConnection(strConnString)
Dim strSQL As String
strSQL = "SELECT ufname,ulname,udate,uid FROM users where
uemail='" & tempemail & "'"
Dim objCmd As New Data.SqlClient.SqlCommand(strSQL,
objConn)

Try
objCmd.Connection.Open()

rptrExample.DataSource = objCmd.ExecuteReader()

rptrExample.DataBind()

objCmd.Connection.Close()
objCmd.Connection.Dispose()

Catch ex As Exception
lblStatus.Text = ex.Message
End Try


End sub


rptrexample is a repeater control but does not display anything and
not even the label display any message or error , so is it because i
am using code behind the request query string does not work, kindly
suggest.

Regards

RE: code behind issue

am 01.02.2008 14:49:00 von PhilJohnson

You have the autoeventwirup set to false in the page directive.

For that you will need to add the event handlers yourself, which they might
not be.

Try changing the autoeventwireup to true and seeing if the event fires.

Also, put a breakpoint in the method right at the top, just to see if it is
running.
--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com


"solutionsdxb@gmail.com" wrote:

> Hi ,
>
> I am using a code behind for asp.net page ,
>
> <%@ Page Language="VB" AutoEventWireup="false"
> CodeFile="Default.aspx.vb" Inherits="_Default" %>
>
> and file default.aspx.vb contains all the code including
>
> Sub Page_Load()
>
> If Request.QueryString("check") = "p" Then
> '1. Create a connection
>
> Dim tempemail As String
> tempemail = User.Identity.Name
> Me.rptrExample.EnableViewState = "True"
> Me.rptrExample.Visible = "True"
>
> Dim objConn As New
> Data.SqlClient.SqlConnection(strConnString)
> Dim strSQL As String
> strSQL = "SELECT ufname,ulname,udate,uid FROM users where
> uemail='" & tempemail & "'"
> Dim objCmd As New Data.SqlClient.SqlCommand(strSQL,
> objConn)
>
> Try
> objCmd.Connection.Open()
>
> rptrExample.DataSource = objCmd.ExecuteReader()
>
> rptrExample.DataBind()
>
> objCmd.Connection.Close()
> objCmd.Connection.Dispose()
>
> Catch ex As Exception
> lblStatus.Text = ex.Message
> End Try
>
>
> End sub
>
>
> rptrexample is a repeater control but does not display anything and
> not even the label display any message or error , so is it because i
> am using code behind the request query string does not work, kindly
> suggest.
>
> Regards
>