Hi I have a web project and i build it in VS2005 with asp.net.the page are .aspx. i want to convert in to myproject.exe file that when a user click on it see the web site in a browser and i don't want to put my website on server on internet.i want to ran in with file.exe in my computer .how should i do this work. please help me
strawberrysh
Posts
-
convert .aspx webpage to file.exe -
error in cascading dropdownlisthow? can you explain me more?
-
error in cascading dropdownlistI try your code,but gave that error again :(
-
error in cascading dropdownlistHi i have two dropdownlist.i bind somthing to first dropdownlist from database.I want when I select an item from dropdownlist1 see some item in dropdownlist2 .but when i select item from dropdownlist1 ,I give this error. i wrote this code but give error : error: invalid attempt to call FeildCount when reader is cloused for binding item to dropdownlist1 i wrote this code in page load:
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "dbo.StoredProcedure19";
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
DropDownList1.DataSource = dr;
DropDownList1.DataTextField = "category_name";
DropDownList2.DataValueField = "category_id";
DropDownList1.DataBind();
con.Close();
dr.Close();
}in select index change of dropdownlist1
protected void drse(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(connectionstring);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "dbo.StoredProcedure21"; cmd.Parameters.AddWithValue("@category\_id", DropDownList1.SelectedItem.Value.ToString()); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { DropDownList2.DataSource = dr; DropDownList2.DataTextField = "type"; DropDownList2.DataValueField = "id\_type"; DropDownList1.DataBind(); con.Close(); dr.Close(); }
}
-
where is the problem of my code?Hi I wrote these code for changing the language of my site.the default language of site is Farsi,and i put two link button in master page for switching the language , and i have two css ,one for Farsi and one for English.when the page load and when i click on en link button ,the language change but the css doesn't change ,I don't know why? in all page except master page i wrote:
protected override void InitializeCulture()
{
if (Session["lang"] != null)
{
string selectedlang = Session["lang"].ToString();
UICulture = selectedlang;
Culture = selectedlang;
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(selectedlang);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(selectedlang);} base.InitializeCulture(); }
in masterpage in click event of link buttons
protected void LinkButton1_Click(object sender, EventArgs e)
{
Session["lang"] = "en-US";
Server.Transfer(Request.Url.PathAndQuery, false);
type='text/css' />";} protected void LinkButton2\_Click(object sender, EventArgs e) { Session\["lang"\] = "fa-IR"; Server.Transfer(Request.Url.PathAndQuery, false); type='text/css' />"; }
and in page load of master page:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["lang"] == null)
{this.Literal1.Text = ""; } else if (Session\["lang"\].ToString() == "en-US") { this.Literal1.Text = ""; } else if (Session\["lang"\].ToString() == "fa-IR") { this.Literal1.Text = ""; } }
asp:Literal ID="Literal1" runat="server">
-
[Message Deleted][Message Deleted]
-
[Message Deleted][Message Deleted]
-
in witch event i shoud write code?(for datalist)I have a datalist that as two button in item template.i want to when i click on a button get the id of that row.that type of id is char.in witch event I should write this code.
-
showing item of list in gridview row.I have a gridview that in every row of it is a textbox.and i have a generic list.I want to show item of list in textboxes of gidview.for example ,if in list has 4 item like 1,2,3,4 ,and gridview has 7 rows,only 4 row of gridview must be complete.4 textbox in full and 3 textbox are empty.what should i do?
-
how can I reach to values(text) of to column in gridview with pressing the button of that row?Hi I have a gridview with several column.in itemtemplate of this gridview i put a button.one of column is product_id and one of them is a textbox that user input something in it. when user click on button in a row ,how can i get the product_id text and text of that textbox of that row.because i want to remove these values from a list.(I want to get text of that cell) in which event? please help me .thanks
-
how can I remove an Item from genericlist?I have a generic list.how can I remove an item from my list?type of my list is string.
-
storing text of textboxes in list ang show them in textbox again(in gridview)the viewstates are true.I want to show text in textboxes agian after postback.
-
storing text of textboxes in list ang show them in textbox again(in gridview)I have a gridview that has a column of textbox that users input something in textbox.I want to retrieve text of textboes after postback,so i wrote this code to store texts of textboxes in list and list in a session.but I don't know how to show them agian in textboxes. my code to store text of textboxes:
protected void Button1_Click(object sender, EventArgs e)
{
List qy = new List();
foreach (GridViewRow gvr in GridView1.Rows)
{
TextBox q = (TextBox)gvr.FindControl("textbox5");
if (Session["quantity"] == null)
{
qy.Add(q.Text.Trim());
Session["quantity"] = qy;
}
else
{
((List)Session["quantity"]).Add(q.Text.Trim());
}
}----------------------------- and in pageloade i wrote this but I don't know how to continue it:
if(Session\["quantity"\]!=null) { List temp=(List)Session\["quantity"\]; foreach(GridViewRow gvr in GridView1.Rows) { TextBox tq=(TextBox)gvr.FindControl("textbox5");
-
deleting a row of gridview and the id of product from a listProducts oProducts = lstProducts.Find(delegate(Products p)
what is delegate?I did't use product class.here is my code:
if (Session["basket"] == null)
{List pid = new List(); pid.Add(productid.Trim()); Session\["basket"\] = pid; } else { ((List)Session\["basket"\]).Add(productid.Trim()); }
Button btnDelete = (Button)GridView1.Rows[e.RowIndex].FindControl("btnDelete");
I don't have RowIndex in my smart list.
modified on Friday, September 5, 2008 3:39 PM
-
deleting a row of gridview and the id of product from a listi have a list that I bind it to gridview.in this list I store id of products.my list is in a session..in itemtemplate column of this gridview I put a button , named delete , for deleting every row.i dont bind this gridview to sqldatasource .it binds to a list.the id of product is one of the columns of gridview.I want to when user click this button the id of that product remove from the list .how should I remove thi sid from my list and where should I write code.please help me.here is gridviewsource:
-
how can I correct my code?it is in template item.I couldn't understand your meaning in question 2? I used breakpoint but in qty is " ",and the data I intered in textbox wasn't there.
-
how can I correct my code?i try the code like you,but i get the same result,(qty is " ") where is my problem?
-
how can I correct my code?yes it is textbox2.i am sure.
-
how can I correct my code?I write this code for showing totalprice in a gridview footer.when this page loaded user input his quantity on textboxes and press a button,after that must see the total price in gridview footer.here is my click event code:(but when I input something in m textboxes and press the button the total price in footer is 0)I used breakpoint and saw the qty is "".how should I correct my code?
protected void Button1_Click(object sender, EventArgs e)
{
if (GridView1.Rows.Count > 0)
{
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
TextBox qty = (TextBox)GridView1.Rows[i].FindControl("textbox2");
Label pr = (Label)GridView1.Rows[i].FindControl("label3");
float total = 0;
if (!string.IsNullOrEmpty(qty.Text))
{
float qty1 = float.Parse(qty.Text);float pr1 = float.Parse(pr.Text); total = total + (qty1 \* pr1); } Label t = (Label)GridView1.FooterRow.FindControl("label3"); t.Text = total.ToString(); } }
-
loop for store Id in a listI want to store Id in a list and list in a session.in another page I want to use these id in a gridview.my code is for shopping cart.