Hi all,
My issue is not solving still..As Lokesh suggested me i have changed everything, but no data is passing into Modularpop window. I am unable to dispaly screenshot here otherwise i would shown the screenshot it would be helpful to understand.
My issue is When an user login( I provided Session for Username) he need to get a popup window showing Today Task.
Is it possible to get data using Session from database. I am posting my source code and C# code once check and let me know. Here i am not using any default.aspx page.
Source Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Loginpage.aspx.cs" Inherits="Loginpage" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> xmlns="http://www.w3.org/1999/xhtml"> runat="server"><%-- <script type="text/javascript"> var popup; function showModalPopUp() { popup = window.open("Default.aspx", "Popup", "width=300,height=350"); popup.focus(); } script>--%>
C# Code
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Loginpage : System.Web.UI.Page { string connStr = ConfigurationManager.ConnectionStrings["NewTaskConnectionString"].ConnectionString; SqlCommand com; //SqlDataAdapter sqlda; //DataSet ds; string str; protected void Page_Load(object sender, EventArgs e) { } protected void btnNewUser_Click(object sender, EventArgs e) { Response.Redirect("Registration.aspx"); } protected void ButtonMe_Click1(object sender, EventArgs e) { SqlConnection con = new SqlConnection(connStr); con.Open(); str = "select * from Task where Userid='" + TextBox1.Text.Trim() + "'"; com = new SqlCommand(str, con); SqlDataReader reader = com.ExecuteReader(); if (reader.Read()) { txtName.Text = reader["TaskName"].ToString(); txtdescription.Text = reader["TaskDescription"].ToString(); txtAssign.Text = reader["Assignedto"].ToString(); txtdate.Text = reader["Taskdate"].ToString(); drpdwnhr.SelectedValue = reader["Starttime"].ToString(); DropDownListhr.SelectedValue = reader["Endtime"].ToString(); txthours.Text = reader["Taskhours"].ToString(); Priority.SelectedValue = reader["Priority"].ToString(); reader.Close(); con.Close(); ModalPopupExtender1.Show(); } } }
Please help me out i need to submit by enter of the day...
Replies
Know the answer? Post it — somebody with the same question will find it here.