Thanks , but still doesn't work

D

domchik

thanks for your help ! unfortunately it still doesn't work . please
take a look at the code of the whole page. I marked with ** the
problematic line below.

Thanks in advance for any ideas


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace mclient1
{
/// <summary>
/// Summary description for MobileWebForm1.
/// </summary>
public class MobileWebForm1 : System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Form OriginPoint;
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.Command go;
protected System.Web.UI.MobileControls.SelectionList cboCities;
protected System.Web.UI.MobileControls.TextBox street;


private string cityName="";
private string streetName = "";
private void Page_Load(object sender, System.EventArgs e)
{

if (!IsPostBack)
{
db Cities = new db((string)Application["connstr"]);
Cities.getProcName ="sp_select_cities";
SqlDataReader drCities = Cities.dr_select_cities() ;
string _text ="";
string _value ="";
while (drCities.Read())

{
_text = drCities["CityName"].ToString();
_value = drCities["CityID"].ToString();
cboCities.Items.Add(new MobileListItem( _text ,_value));

}
}


}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.cboCities.SelectedIndexChanged += new
System.EventHandler(this.SelectedIndexChanged);
this.go.Click += new System.EventHandler(this.go_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void go_Click(object sender, System.EventArgs e)
{



**** THE PROBLEM IS HERE !!!!! cboCities.Selection IS NULL AT THIS
POINT !!! ****

cityName = cboCities.Selection.Value;

}

private void SelectedIndexChanged(object sender, System.EventArgs e)
{

}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top