|
You can use sessions also
|
|
|
|
|
how to use session. can u send me the code for it.
Thanks in advance.
Mohinder Singh
|
|
|
|
|
Suppose that I want to send a private message to a person and sender name and reciever name is saved in 2 session variables like this.Session["sender"] and this.Session["Reciever"].
Now I open 2 browser and in browser one ,click on person1 "send message" bottun and go to a page to writing message body, and then in browser 2 click on person2 "send message" bottun and go to a page...!
Now I go to browser 1 and click on "Send" bottun. the value of this.Session["reciever"] is person2 but I want to send message to person 1 .
What should we do in this case ?
|
|
|
|
|
hi all,
In my page,I have to enter only year(eg 1999) in the textbox.but it should be inserted as datetime format in DB.
how to convert year to datetime format in c#.
Eg: 1999 to 1/1/1999 12:00:00 AM
Plz give ur suggestions
thanks in advance
cheers
sangeet
|
|
|
|
|
For Every year the date and time is same ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Yes..all the year with same date and time.
I got it by just adding Convert.ToDateTime(@"1/1/" + Year_Tbox.Text)
thanks for ur reply..
cheers
sangeet
|
|
|
|
|
I tried to use below code for my login page. But I am getting below 4 errors which I am unable to resolve. Can you help me please.
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
<br />
namespace WebSite2<br />
{<br />
public class Login : System.Web.UI.Page<br />
{<br />
protected System.Web.UI.WebControls.Label LabelError;<br />
protected System.Web.UI.WebControls.Button ButtonLogin;<br />
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;<br />
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;<br />
protected System.Web.UI.WebControls.Label Label1;<br />
protected System.Web.UI.WebControls.TextBox txtpassword;<br />
protected System.Web.UI.WebControls.Label Label2;<br />
protected System.Web.UI.WebControls.TextBox txtusername;<br />
<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
}<br />
<br />
#region Web Form Designer generated code<br />
override protected void OnInit(EventArgs e)<br />
{<br />
InitializeComponent();<br />
base.OnInit(e);<br />
}<br />
<br />
private void InitializeComponent()<br />
{<br />
this.Buttonlogin.Click += new System.EventHandler(this.Buttonlogin_Click);<br />
this.Load += new System.EventHandler(this.Page_Load);<br />
<br />
}<br />
#endregion<br />
<br />
private void buttonlogin_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
LabelError.Visible = false;<br />
string uid, pwd;<br />
uid = txtusername.Text;<br />
pwd = txtpassword.Text;<br />
string accessLevel = CheckPassword(uid, pwd);<br />
if (accessLevel != "")<br />
{<br />
Session["UID"] = uid;<br />
Session["AccessLevel"] = accessLevel;<br />
Response.Redirect("Page2.aspx");<br />
<br />
}<br />
else<br />
{<br />
LabelError.Visible = true;<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
ex.ToString();<br />
}<br />
}<br />
private string CheckPassword(string uid, string pwd)<br />
{<br />
return "1";<br />
<br />
<br />
}<br />
private void btnNewUser_Click(object sender, System.EventArgs e)<br />
{<br />
Response.Redirect("NewUser.aspx");<br />
} <br />
}<br />
}
Below are the Errors.
Error 4 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). C:\Documents and Settings\Amarnath\My Documents\Visual Studio 2005\WebSites\WebSite2\Login.aspx.cs 1 33 C:\...\WebSite2\
Error 1 'ASP.login_aspx.GetTypeHashCode()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website2\34e44d00\b8acac28\App_Web_imunwsug.0.cs 870
Error 2 'ASP.login_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website2\34e44d00\b8acac28\App_Web_imunwsug.0.cs 874
Error 3 'ASP.login_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website2\34e44d00\b8acac28\App_Web_imunwsug.0.cs 192
|
|
|
|
|
For Error 4
PLease check the inherite attribute in the Login.aspx page it should be
WebSite2.Login
Again for errors 1,2 & 3 not have any idea ?
Is it showing for this application only ? or getting problems for other also ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Error 1,2,3 are coming up for only this application.
|
|
|
|
|
Hi
I dont know whether this would solve your problem, change access modifier for all button click events to 'protected' (btnNewUser_Click and buttonlogin_Click).
Harini
|
|
|
|
|
I am getting Error in exporting crystal report to pdf
the error is like :
CrystalDecision.CrystalReports.Engine.ExportException...Additional information: Error in File ..*.rpt: Error detected by export dll
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Give some more information
|
|
|
|
|
Hi
This is not an error while exporting to PDF. It is your report error. It may be a formula or SQL Expression or SQL query error.
Try to preview your report in the crystal report design. Which version you are using ???
Harini
|
|
|
|
|
Thanks harini.
I found the problem. The problem was in a text field.
Actually i am using xsd in my crystal report.
In one of the field i was passing more than 4000 characters. It gave me an error when i export to pdf. in crystal report viewer its not giving any error
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
hi,
i have created a dynamic menu control for my web application.The page is not automatically resizing its length for the menus - submenu.So the submenus are not displayed completely.But if the pagecontent is large then the entire submenus displays without any problem. I have used querystring to display my pages.
Suggestions and solutions are invited.
Thanks
Jith
|
|
|
|
|
Hello
Can you please help me with the code after the user selected the date for the calender,the date will be displayed in the DateText-Box.I want the week number to be displyed automatically in the week-numberTextbox,after the user selected the date in the calender.....
Thankm you in advance
oga m
|
|
|
|
|
In the Calendar1_SelectionChanged event use the following....
System.Globalization.Calendar cal=System.Globalization.CultureInfo.InvariantCulture.Calendar;
WeekTxt.Text= (cal.GetWeekOfYear(Calendar1.SelectedDate, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday)).ToString();
Koushik
|
|
|
|
|
|
i want to add templet column dynamically to grid
only at last position i am geting check box
tmf.ItemTemplate = New Tempfield()//implements ittemplet
GridView2.Columns.Add(tmf)
GridView2.DataSource = dsJobsynReq // dataset
GridView2.DataBind()
|
|
|
|
|
I didnt understood ur problem but may be u need to use for loop.
All the Best...
|
|
|
|
|
Dear all,
I have a page parent.aspx which contains an iframe for which child.aspx has been given as source. Now parent.aspx contains a hidden filed. mY requirement is to access this hidden field from child.aspx (server side i.e C# but not client side). Is there any way to achieve this. very urgent.
awaiting reply
Ramesh.Kanjinghat
|
|
|
|
|
Friends,
I am just a beginner and I have some doubts with web.config file.
It would be helpful to me if anyone come up with answers for these questions.
1. When a web.config file is called in a .net web application?
2. Is it possible to have more than one web.config file for an applicaiton?
3. What is the concept behind declaring the connection string in web.config file?
4. What is the difference between app.config and web.config files?
|
|
|
|
|
web.config is used with web applications. web.config will by default have several configurations required for the web application. You can have separate web.config files for each directory in your web application, in addition to the one in the root. For each web page, by default, system will look for a web.config in the same folder as the page and if not found, then looks in the parent folder.
app.config is used for windows applications. When you build the application in vs.net,i think it is same as web.config but not sure...
declaring a connection string in the web.config file is as to declare connection strring once and use in different webforms otherwise in each webform we have to declare connection string which is redundant.the string can be retrieved as follows
System.Configuration.COnfigurationSettings.AppSettings["Key"]
Koushik
|
|
|
|
|
Thanks for your reply Kousik.
But when this web.config file is called?
Is it that, each time when a user request for a page, the web.config file is called?
Or, is it like, web.config is called only when we try accesing the variable/key declared and stored in web.config?
-Saranya
|
|
|
|
|
HI Friend
Asked a meaning full question
Saranya B wrote: 1. When a web.config file is called in a .net web application?
At run time (When Application runs) common language runtime reads (such as assembly binding policy, remoting objects, and so on), and settings that the application can read.
Saranya B wrote: 2. Is it possible to have more than one web.config file for an applicaiton?
Yes , Web.config files can appear in multiple directories in ASP.NET applications.
Saranya B wrote: 3. What is the concept behind declaring the connection string in web.config file?
Security and Consistent Suppose if the connection string has changed then i need to change it only once i.e. in the web.config other wise i have to check each and every page and update it.
Saranya B wrote: 4. What is the difference between app.config and web.config files?
app.config is used for windows applications. When you build the application in vs.net, it will be automatically renamed to <appname>.exe.config and this file has to be delivered along with your application.
If you make any changes to the web.config, web application will immediately load the changed config. But in case of <application name="">.exe.config, you have to restart the application.
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|