|
How can i disable panes so they do not expand on click until i change it via code behind?
Thank you for your help.
|
|
|
|
|
I am using .net 2005.i am doing my project in asp.net.my project title is master log attendance.how to get all employee id in to single variable?
We have got employee id from single table by using single variable.but the datas are displayed for final id only.but we want to get more employee id from single variable.
The following code
protected void img_submit_Click(object sender, ImageClickEventArgs e)
{
from_date = txt_fr_date.Text;
to_date = txt_to_date.Text;
emp_name = ddl_emp_name.SelectedValue;
check();
}
void check()
{
System.TimeSpan dt_diff = Convert.ToDateTime(to_date).Subtract(Convert.ToDateTime(from_date));
days = dt_diff.Days;
dt.Columns.Add(new DataColumn("ID", typeof(string)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
string empid1;
com = new SqlCommand("select distinct(emp_id) from tbl_report", con);
dr = com.ExecuteReader();
while (dr.Read())
{
empid1 = dr.GetString(0);
}
dr.Close();
for (int i = 0; i <= days; i++)
{
sql_date = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
sql_date1 = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
dt.Columns.Add(new DataColumn(sql_date1, typeof(string)));
drow = dt.NewRow();
com = new SqlCommand("select distinct rpt.emp_id as EmployeeID,card.username as EmployeeName,min(case when rpt.datetime1='" + sql_date + "' then rpt.datetime1 end) as '" + sql_date + "' from tbl_card as card,tbl_report as rpt where card.fkdata=rpt.emp_id and rpt.datetime1='" + sql_date + "' and emp_id='" + empid1 + "' group by rpt.emp_id,card.username", con);
dr = com.ExecuteReader();
while (dr.Read())
{
drow[0] = dr.GetString(0);
drow[1] = dr.GetString(1);
drow[i+2] ="x";
dt.Rows.Add(drow);
}
dr.Close();
}
GV_musterrole.DataSource = new DataView(dt);
GV_musterrole.DataBind();
}
in above code,i get all employee id into variable name as empid1.then i put empid1 for employeeid field in where condition of query in for loop.
but displayed only one employee id as follow in grid view,
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--370--ramesh---------------------------------------------------------------x
so i want to get all employee id into single variable name as empid1.then put empid1 for employeeid field in where condition of query means,i want to come all employee id details as follow.
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--366--dinesh---------------------------x-----------------x----------------x
--367--ram------------------------------x-----------------------------------
--369--guru-----------------------------x----------------------------------x
--370--ramesh--------------------------------------------------------------x
|
|
|
|
|
ram67 wrote: We have got employee id from single table by using single variable.but the datas are displayed for final id only.but we want to get more employee id from single variable.
Have a bit of patience dude. Dont repost as its not gonna help you anyway.
Next, posting your complete code wont help.
Be specific and clear about your problem.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Too impatient to wait for original post.
Blog link to be reinstated at a later date.
|
|
|
|
|
XML.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hey guys, I'm trying to use a master and detail type of datagrid, when I select a row for a file, I want to get the details of homany times it has been downloaded and who has downloaded it from another table ! I get an error when I use this code !
int FileID = (int)GridView1.DataKeys[GridView1.SelectedIndex];
the error:
CS0030: Cannot convert type 'System.Web.UI.WebControls.DataKey' to 'int'
Even I tried to add SelectedDataKey in the property of my master grid and then use the following code to get it !
int FileID = (int)GridView1.SelectedDataKey.Values[0];
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds);
DetailsView1.DataSource = ds.Tables[0];
DetailsView1.DataBind();
the error:
System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'FileID'.
I ve gone through many articles and I ve gotten to the same conclusion that the code is correct but somehow there is something wrong with mine !!!
Please help me out !
|
|
|
|
|
am using .net 2005.i am doing my project in asp.net.
my project title is master log attendance.
i want to display datas in single row for same name and id.
i have 2 table named as attendance and employeedetails.
The following code has worked very well.But datas are displayed in multiple row for same name and id.
protected void img_submit_Click(object sender, ImageClickEventArgs e)
{
from_date = txt_fr_date.Text;
to_date = txt_to_date.Text;
emp_name = ddl_emp_name.SelectedValue;
check();
}
void check()
{
System.TimeSpan dt_diff = Convert.ToDateTime(to_date).Subtract(Convert.ToDateTime(from_date));
days = dt_diff.Days;
dt.Columns.Add(new DataColumn("ID", typeof(string)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
for (int i = 0; i <= days; i++)
{
sql_date = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
sql_date1 = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
dt.Columns.Add(new DataColumn(sql_date1, typeof(string)));
drow = dt.NewRow();
com = new SqlCommand("select distinct rpt.emp_id as EmployeeID,card.username as EmployeeName,min(case when rpt.datetime1='" + sql_date + "' then rpt.datetime1 end) as '" + sql_date + "' from tbl_card as card,tbl_report as rpt where card.fkdata=rpt.emp_id and rpt.datetime1='" + sql_date + "' and emp_id='366' group by rpt.emp_id,card.username", con);
dr = com.ExecuteReader();
while (dr.Read())
{
drow[0] = dr.GetString(0);
drow[1] = dr.GetString(1);
drow[i+2] ="x";
dt.Rows.Add(drow);
}
dr.Close();
}
GV_musterrole.DataSource = new DataView(dt);
GV_musterrole.DataBind();
}
in above code,i applied query with groupby and distinct in for loop statement.
using above code,the following output is coming in grid view,
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--366--dinesh---------------------------x
--366--dinesh-------------------------------------------x
--366--dinesh---------------------------------------------------------------x
here 3 lines are displayed using for loop statement for same name and id.
But I want to display in single line using for loop statement for same name and id as following output.How to do this?
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--366--dinesh---------------------------x-----------------x----------------x
|
|
|
|
|
Maybe I'm going mad but I just can't get the PreRender method to fire on a web page.
I'm using VS2005 and have created a blank website and have right clicked on the default.aspx page and selected 'View Component Designer' and from there selected the thunderbolt and double clicked PreRender. This created the PreRender method in the 'code behind' and also hooked it up in the InitializeComponent method. If I just put a simple statement in the PreRender method to set the value of a label for example it does not fire. Also, if I put a debug mark in the PreRender method it does not fire. What's going on?
|
|
|
|
|
it's working Fine.
protected void Page_PreRender(object sender, EventArgs e)
{
Button1.Text = "Hi Abhijit";
}
cheers,
Abhijit
|
|
|
|
|
I have the same signature but it still isn't firing. This is the code in my page.
private void InitializeComponent()
{
this.PreRender += new System.EventHandler(this._Default_PreRender);
}
private void _Default_PreRender(object sender, EventArgs e)
{
Label1.Text = "hi";
}
|
|
|
|
|
Are you on ASP.NET 1.1 ? From where this InitializeComponent() is getting called ?
|
|
|
|
|
<cc1:passwordstrength id="PasswordStrength1" runat="server" targetcontrolid="txt_pass" displayposition="RightSide" preferredpasswordlength="10" strengthindicatortype="Text" xmlns:cc1="#unknown">
i use this code to check password Strength but its not working with page default1.aspx while properly working with another page and show message while on default page its not work or not show any type of error. what the problem. suggest anyone.
I will do my best?
|
|
|
|
|
check your page property means @Page directive setting.
|
|
|
|
|
I know this is quite feasible on a project I looked at for a friend, with nothing fancy in code or data, from which he's just removed much 'automatic' data binding. Has anyone else had to do this? The client only works with VS 2003, and wants compatible source.
|
|
|
|
|
is there an on focus event for a page,c#,(similar to the one in windows), if so how do i go abt it.
|
|
|
|
|
No, there isn't. A server side focus event would be totally pointless, as it would need a postback, which would make it lose focus.
You have to use to focus event in Javascript.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Coders,
I am facing a unique problem at my work. I have following code:
I have one <input type="file" id="txtimgfile".....;
and one <img id="imgpreview" src"../images/NoImage.jpg....;
and one Button "Preview" and its OnClick function is
PreviewPromo() which is as below:
function PreviewPromo()
{
var imgpre =document.getElementById("imgpreview");
var imgadd =document.getElementById("txtimgfile");
imgpre.src = imgadd.value;
imgpre.onerror = "../images/NoImageFound.jpg";
}
I am giving path of image selected bu user from 'txtimgfile' to my image for preview on button click.
Problem is when I run my code to IE7 its not showing image I select, but code is working fine in IE6..
Can anyone help me????
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
I suspect the problem is that your file input value is the full path to file on the server - c:\foldername..etc/whatever... and IE7 probably doesn't like this. Try parsing the imgadd.value var to strip out from it anything above the application root folder, and leave just the relative path....
|
|
|
|
|
I am getting error which is written bellow when click on image button that have PostBackUrl="~/Admin/BusRateSchedule.aspx"
"Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. "
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
|
Knock it off already! We don't care if it is urgent.
Blog link to be reinstated at a later date.
|
|
|
|
|
Hi I am having a problem in that I have a list box on the form and I have it so that depending on the value from an sql database the colour changes. The thing is I want to show more than one string (currently the data from the same table in the database) on the same line in the list box.
I know that I can concatinate all of the string values I want to from the database and display them as one string but I was wondering if there was a better way in which I can have some sort of structure to show where one value ends and the next starts instead of having random lengthed lines.
regards
gretna
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
i had an requiremnt for same case, but i have implement it using string concatination.
Gretna wrote: I was wondering if there was a better way in which I can have some sort of structure to show where one value ends and the next starts instead of having random lengthed lines.
you can use Table or GridView
or you use some CutomControl , in code project there is an sample for the same.
cheers,
Abhijit
|
|
|
|
|
Hi I have now moved back to my origianl problem which is the last thing on this screen to do. If i were to use a Gridview is there anyway I can add the data to it from a data reader with out having to bind it to a datasource at the start, and do you know if its possible to change the colour of the text so depending on the value of the row it changes the colour of the text.
Example
Row 1: firstname, lastname in red
Row 2: firstname, lastname in blue
Row 3: firstname, lastname in blue
Row 4: firstname, lastname in red
Row 5: firstname, lastname in green
Thansk for the help so far.
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
How to send the value of DDL to another form?
The Developer - CEH
|
|
|
|