|
Meaning Populating the Listbox at run time ? Yes
like this
private void Bind_Tags_List()
{
BLL.BLL obj = new BLL.BLL();
String DB = Convert.ToString(Session["ActiveDatabase"]);
try
{
DataSet ds = obj.Get_Tag_Staff_Only(DB);
lstbxTags.DataSource = ds;
lstbxTags.DataTextField = "DESCR";
lstbxTags.DataBind();
}
catch (SqlException ex)
{
lblAdminStatus.Text = ex.Message.ToString();
}
}
On page load
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Vuyiswa Maseko wrote: Meaning Populating the Listbox at run time ? Yes
I want to mean creating the List Box Control ? Are you creating the Listbox at runtime ?
Vuyiswa Maseko wrote: On page load
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
No am not creating the Listbox control at runtime , but populating it at Runtime. I have Notice something String. When i select Something from the lstbxTags nothing get Displayed in the ListBox1 and when i select other Control that has no code in it in my page like a button , the ListBox1 gets Populated.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
I found the Problem; the Problem is that one of my Listboxes had a Autopostback property to False. I can’t believe that I spent the whole day trying to solve this problem and change my code, but still. I think this is one of those days
Thank you for your Help
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
use the following line
ListBox1.Items.Add(lstbxTags.SelectedItem);
Mahendra Bisht.
|
|
|
|
|
That will Work but in my case, after selecting a Value from the lstbxTags i got to the database and look for it ID , and from that , another SP is Called that will retrieve the Records based on that ID. So this is like a Filter thing. So a User will save a Filter tag with some records. Now i will be Displaying records based on that Filter
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
so your question solved now or not.
Mahendra Bisht.
|
|
|
|
|
Not Solved.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Hi,
I've implemented forms Authentication security using microsoft FormsAuthentication sample and eveything is OK.
Now, I've created a web Application that is FormsAuthenticat and in Login page I've used the code in login page of microsoft sample. the verification is OK, but in my page when I want to call a method of report service this error appears:
<br />
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- <br />
Reporting Services Error<br />
--------------------------------------------------------------------------------<br />
<br />
The Authentication Extension threw an unexpected exception or returned a value that is not valid: identity==null. (rsAuthenticationExtensionError) Get Online Help <br />
<br />
--------------------------------------------------------------------------------<br />
SQL Server Reporting Services --. <br />
In my page I have:
<br />
Dim rs As New ReportingService2005<br />
rs.Url = "http://localhost:8080/ReportServer/reportservice2005.asmx?wsdl"<br />
Dim TmpCI() As CatalogItem = rs.ListChildren("/contracts", True)<br />
Best wishes
|
|
|
|
|
Hi,
I am using list control in sql server reporting services.How can i repeat the list 3 times in a row.
Thanks
|
|
|
|
|
anyone knows how to implement a timer in ASP.NET
i tried this but it did not work
protected System.Timers.Timer _timer;
protected void Page_Init(object sender, EventArgs e)
{
// initialize the time control
_timer = new System.Timers.Timer(5000);
// subscribe to the Elapsed event
_timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
}
protected void Page_Load(object sender, EventArgs e)
{
_timer.Start();
}
private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
// Do whatever you want to do on each tick of the timer
}protected System.Timers.Timer _timer;
protected void Page_Init(object sender, EventArgs e)
{
// initialize the time control
_timer = new System.Timers.Timer(5000);
// subscribe to the Elapsed event
_timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
}
protected void Page_Load(object sender, EventArgs e)
{
_timer.Start();
}
private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
// code i want to execute at each tick
}
Please help
Thanks in advance
|
|
|
|
|
are you talking about Timers in client End.
After ASP.NET renders your page, the client only receives the html output.
so use
javascript:
setTimeOut('yourfunction()',1000);
or
setInterval('yourfunction()',1000);
yourfunction() is the callback.
|
|
|
|
|
|
|
Hi,
I have a website in which users are assigned userid and they have to save their daily report in the site after logging in.
I keep userid in session variable and while saving the data it is also saved in the report table.
But yesterday what happened a user when saved his report, it was saved with other user's id.
I also make a log of user login time and in it the login time of both users is also not same even it has difference of hours.
Can anyone help me out why it happened? and how could i apply measures so that it would not happen in future..
Abhijit, Yusuf or anyone else there who could help me..
modified on Thursday, April 9, 2009 3:24 AM
|
|
|
|
|
devesh sinha wrote: But yesterday what happened a user when saved his report, it was saved with other user's id.
May be it can be cause of session problem. How did you clean up the session while log off from the application ? And What data they are saving ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
On logout user is redirected to homepage where i have removed all the session variable and also in Global.asax.cs I have removed session and application at session_end.
Data saved by users is their daily work report.
I have also made a fucntion to check session on each page and in case it is expired user is redirected to login page.
|
|
|
|
|
Devesh, can you please put the code for Data Save Section , and Log Out Section?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
After checkin some condition this code comes. I ahve used a stored procedure to save the data and the userid is passed through a variable "usrid" which i assigned the value on top from the session variable.
SqlConnection con = cmn.getcon();
if (con.State == ConnectionState.Open)
con.Close();
con.Open();
SqlDateTime sqldatenull;
sqldatenull = SqlDateTime.Null;
SqlCommand cmd = new SqlCommand("usp_OrderMaster_Ins", con);
cmd.CommandType = CommandType.StoredProcedure;
string a = txtVisitHr1.Text.ToString();
string b = txtVisitMin1.Text.ToString();
cmd.Parameters.Add("@VisitDate", SqlDbType.DateTime, 8).Value = cmn.MMDDYYtoYYMMDD(txtVisitDate1.Text);
cmd.Parameters.Add("@VisitType", SqlDbType.Char, 1).Value = ddlVisitType1.SelectedValue.ToString();
cmd.Parameters.Add("@Usr_ID", SqlDbType.Int, 4).Value = Convert.ToInt32(usrid);
cmd.Parameters.Add("@FinYr", SqlDbType.Char, 7).Value = cmn.FinYr();
cmd.Parameters.Add("@OutledId", SqlDbType.Int, 4).Value = ddlPartner1.SelectedValue;
int itmcnt = gdOrderDetails.Items.Count;
string ordst = "";
if (itmcnt > 0)
{
ordst = "Y";
}
else
{
ordst = "N";
}
cmd.Parameters.Add("@OrderStatus", SqlDbType.Char, 1).Value = ordst;
if (txtNextVisitDt1.Text.ToString() == "")
{
cmd.Parameters.Add("@NextVisitDate", SqlDbType.DateTime, 8).Value = sqldatenull;
}
else
{
cmd.Parameters.Add("@NextVisitDate", SqlDbType.DateTime, 8).Value = cmn.MMDDYYtoYYMMDD(txtNextVisitDt1.Text.ToString());
}
cmd.Parameters.Add("@Expenses", SqlDbType.Money, 8).Value = "0";
cmd.Parameters.Add("@Remarks", SqlDbType.VarChar, 100).Value = txtRemarks1.Text.ToString();
cmd.Parameters.Add("@SupplierID", SqlDbType.Int).Value = ddlSupplier.SelectedValue;
if (txtDelDt1.Text.ToString() == "")
{
cmd.Parameters.Add("@DeliveryDt", SqlDbType.DateTime, 8).Value = sqldatenull;
}
else
{
cmd.Parameters.Add("@DeliveryDt", SqlDbType.DateTime, 8).Value = cmn.MMDDYYtoYYMMDD(txtDelDt1.Text);
}
cmd.ExecuteNonQuery();
con.Close();
Label1.Text = "Visit Details Saved....";
Label1.Visible = true;
Label1.UpdateAfterCallBack = true;
ddlSupplier.Enabled = true;
ddlSupplier.UpdateAfterCallBack = true;
Logout Section:-
On logout user is redirected to homepage where on page load this code is written:
Session["Usr_Id"]="no";
Session["Section"] = "";
in Global.asax.cs folloing code is given at session_end
Response.ExpiresAbsolute = DateTime.Now;
Session.Abandon();
Response.Expires = 0;
Response.Cache.SetNoStore();
Session.RemoveAll();
|
|
|
|
|
devesh sinha wrote: Logout Section:-
On logout user is redirected to homepage where on page load this code is written:
Session["Usr_Id"]="no";
Session["Section"] = "";
Try to do it in Log Out button Click
try
{
Session.Abandon();
Response.Redirect("Home.aspx", false);
}
catch (Exception ex)
{
}
And nothing to do with global.asax until and unless you want to some other stuff while log off. Session.Abandon() will do all stuff for you.
Hope this will help you
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Abhijit here what i think is the same session shared by two users.
So how to prevent that?
As in my case one user is logged in into his account, there it was ok even on welcome message i can see his username appearing but while saving the data other user's id was passed. I think it is beacuse of sharing of same session by two users and this thing happened for the first time after more than 1000 entries.
What u say about this??
|
|
|
|
|
devesh sinha wrote: what i think is the same session shared by two users.
For every client session is unique. How the user are sharing session in your case? I am not clear.
devesh sinha wrote: but while saving the data other user's id was passed.
check and verify the logic where you are retrieving data from session.
devesh sinha wrote: think it is beacuse of sharing of same session by two users and this thing happened for the first time after more than 1000 entries.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Ya i agree with you this thing has also puzzled me.
But i dont find any problem in the logic. I am saving the userid to database which i retrieve from the session so how it is possible that other user's id is fetched while saving whereas the user is seeing all the information related to him on the screen but on saving the data it goes it other person account.
|
|
|
|
|
i have developed project in vb6.0,reporting tool crystal report 8,database ms access 2007.when executed program report was correct but converting report to .txt file inbetween line space is there.how can i remove that space
|
|
|
|