No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
18 Posted Topics
The following code may help you to open excel file with in the same asp.net web page [code=asp] using System.Data.OleDb; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { OleDbConnection ExcelConection = null; OleDbCommand ExcelCommand = null; OleDbDataReader ExcelReader = null; OleDbConnectionStringBuilder OleStringBuilder = null; …
Use Querystring concept .pass department and rooms as string type to second form. Step1: On Button Click- form1 Response.Redirect("Form2.aspx?Dept=" + Textbox1.Text +"&Rooms="+Textbox2.Text); Step2 : Bind Grid --Form2 String Dept=Request.QueryString["Dept"].tostring(); String Rooms=Request.Querystring["Rooms"].tostring(); Step 3: Pass these two variables to Stored Procedure. I thought this will help you. thanks
string[] first=new string[3]; int sum = 0; first[0] = "1 2 3 4 5"; first[1] = "1 4 5"; first[2] = "1 3 4 5"; string second= "2 3"; foreach (string a in first) { if (a.Contains(second)) sum++; } Console.WriteLine(sum); Console.ReadLine();
[code] SqlConnection con = new SqlConnection("Data Source=SECANT-B0A227A3;Initial Catalog=Logins;integrated security=True;"); SqlCommand cmd = new SqlCommand("select email,password from login", con); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { if ( txtboxemail.Text.Trim()==rdr[0].ToString().Trim() && textboxpassword.Text.Trim()==rdr[1].ToString().Trim()) { Response.Redirect("~/Home.aspx"); } } [/code]
hi, step 1: create a db Employee and Table EmpDetails having Columns Empid(int) set its isidentity to true,EmpImage(Image),EmpName(nchar(20)). step 2: create an aspx page [code=html] <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>Save Retrieve Images</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="lblEmpName" runat="server" Text="Employee Name"></asp:Label> <asp:TextBox ID="txtEName" runat="server"></asp:TextBox> <br …
Hi Shine, You need to used PopUp Windows OTHERWISE you will need to use some State management technique(like QueryString, Session etc) to achieve this. Let me know if you were looking into some other way of solving this. Thanks, Chithra
Add below code to aspx page [code] <asp:Menu ID="Menu1" runat="server" Width="164px" OnMenuItemClick="Menu1_MenuItemClick" > <Items> <asp:MenuItem Text="Home" Value="Home" NavigateUrl="Home.aspx"></asp:MenuItem> <asp:MenuItem Text="News" Value="News" NavigateUrl="News.aspx"></asp:MenuItem> <asp:MenuItem Text="About Us " Value="About Us " NavigateUrl="AboutUs.aspx"></asp:MenuItem> <asp:MenuItem Text="Contact us" Value="Contact us" NavigateUrl="ContactUs.aspx"></asp:MenuItem> </Items> </asp:Menu> <asp:LoginStatus ID="LoginStatus1" runat="server" Style="z-index: 100; left: 39px; position: absolute; top: 185px" Width="116px" …
add below code in aspx.cs [code] public partial class _Default : System.Web.UI.Page { DataGrid dg = new DataGrid(); protected void Page_Load(object sender, EventArgs e) { dg.DataSource = SqlDataSource1; dg.DataBind(); Panel1.Controls.Add(dg); } protected void Button1_Click(object sender, EventArgs e) { foreach (DataGridItem dgi in dg.Items) { if (dgi.Cells[0].Text == TextBox1.Text) { for(int …
[code] <script runat="server"> void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args) { if (args.Value.Length < 8) { args.IsValid = false; } else { args.IsValid = true; } } </script> [/code] replace your Script with the above code try this ...... Chithra
Try this [code] SELECT EventDate, Activity FROM Dani_Table WHERE (EventDate > GETDATE()) order by EventDate asc [/code]
[code] <asp:TextBox ID="txtName" runat="server"/> <asp:Button ID="btnSubmit" runat="server" Text="Submit" /> <asp:RegularExpressionValidator ID="regexpName" runat="server" ErrorMessage="This expression does not validate." ControlToValidate="txtName" ValidationExpression="^[a-zA-Z'(.|_|' ')\s]{1,40}$" /> [/code]
Try this code Default.aspx.cs [code] protected void DetailsView1_DataBound(object sender, EventArgs e) { // Get the pager row. DetailsViewRow pagerRow = DetailsView1 .BottomPagerRow; // Get the Label controls that display the current page information // from the pager row. Label pageNum = (Label)pagerRow.Cells[0].FindControl("PageNumberLabel"); Label totalNum = (Label)pagerRow.Cells[0].FindControl("TotalPagesLabel"); if ((pageNum != null) …
Your code on Default.aspx is as shown below [code=asp.net] Server.Transfer("Default2.aspx ? name =roseline & password = pass@123"); [/code] change the above code by avoiding space in the string Shown below [code=asp.net] Server.Transfer("Default2.aspx?name=roseline&password=pass@123"); [/code]
[code=asp.net] TextBox date_search = (TextBox)Page.PreviousPage.FindControl("TextBox1"); DateTime dateData; if (date_search.Text!="" ) { dateData =Convert.ToDateTime(date_search.Text.ToString()); TextBox2.Text = dateData.ToLongDateString(); } } [/code]
The purpose of an Aspx page is to run at application server, and not to be viewed using browser. Reason you are getting error on opening the aspx file on browser is because the browser finds that the Aspx does not confirm to regular XML standards. 1. You can remove …
[code]protected void Page_Load(object sender, EventArgs e) { if (Page.PreviousPage != null) { TextBox test = (TextBox)Page.PreviousPage.FindControl("search"); if (PreviousPage.IsCrossPagePostBack == true) { Label1.Text = test.Text; } else { Label1.Text = "Not a cross-page post."; } } }[/code]
I couldnot understand your question entirely. See if this is what you wanted to know. In my example I have a GridView which gets data from a SQLDataSource(StoredProcedure). I will pass a username through QueryString, and the GridView would print the Username and the count of that username. Now I …
[code]using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; [B]//Reference for setting color using System.Drawing;[/B] public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { [B] Label1.ForeColor = Color.Yellow ; Label1.BackColor = Color.Black ;[/B] } }[/code]
The End.
chithrasujith