|
because the basic requirement is that I provide a online html editor (implemented by using textbox) which allows user types in html markup , and submit to database.
and also I have other textboxes on the same page which do need the asp.net pagevalidate feature,
is any solution? any suggestion would be appricated!
Cheers,
Ming
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["mysession"].ToString() != null)
{
Label1.Text = "Welcome " ;
}
else
{
Response.Redirect("Login.aspx");
}
}
}
I have the above code in one aspx page. Before logging in if someone opens this page, it should open Login page. But instead of showing theLogin page, it shows Server Error. Any one have an idea.
|
|
|
|
|
What error are you getting in the page ?
Could you clarify that
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Soumini Ramakrishnan wrote: if (Session["mysession"].ToString() != null)
This is wrong. It should be
if (Session["mysession"] != null)
{
Label1.Text = "Welcome " ;
}
else
{
Response.Redirect("Login.aspx");
} When session is null , you can't invoke it's ToString() method.
|
|
|
|
|
Hi,
I had made some changes in yr code, just see below.
Try this code, i hope u can not get an error...
if (!IsPostBack)
{
if (Session["mysession"] != null)
{
Label1.Text = "Welcome ";
}
else
{
Label1.Text = "test";
}
}
i hope it will help u..
Rana Krishnraj
modified on Wednesday, April 2, 2008 9:30 AM
|
|
|
|
|
Thank you all. The given hints helped me and I rectified my problem.
|
|
|
|
|
hai to all,
My requirement is ,i want to insert multiple no of rows on a single save command with differnt values in a data table.
I want to do this using stored procedure with transaction.i dont have any idea of using procedure for multiple columns.
how to do this??
i have 6 fields which i have to insert differnt values in each row.No of rows also varied.can anybody give me simple example so that i can implement in my application.
i want to commit the data iff no of rows i want to insert equal to count(*) from that perticular table.
How to do this??please give me idea.
thanks in advance
kissy
|
|
|
|
|
How are you inserting records right now? We can't help unless we know what database you're using and how you're connecting to it. The commands are different depending on your answer. Most languages (both client side and SQL implementations) have a BEGIN TRANSACTION, COMMIT TRANSACTION and ROLLBACK TRANSACTION statement of some kind. I suggest you look up those commands for the platform you're using.
|
|
|
|
|
Hai All,
My requirement is to show the contents of a word file as it is in a dynamic web page without loosing it's formats?
Note that there will be images and text in my word file?
WHAT I DID
i tries to convert the .doc file into an html file and stores the multilingual code in the database, from there iam showing the contents into a dynamic page.
My problem is that the alignment is been breaking as some images are in the .doc file.
help me pls because it seems to be a complex task ?
|
|
|
|
|
|
Hi All,
I'm developing one application in asp.net 2.0
In that application logged in user can view the pages. If the user close the page with out signing out means how can I maintain their login status?
If I use the javascript in body unload means, I have to implement this script in many of the pages.
Give some better idea to solve this prob.
Thanks in Advance
A.Muthunagai
|
|
|
|
|
Muthunagai.A wrote: If the user close the page with out signing out means how can I maintain their login status?
Are you maintaining any DB flags for user status ? Usually you need to check the session existence in each page_load. If session is not exist, redirect user to the login page.
|
|
|
|
|
What do you mean by
Muthunagai.A wrote: how can I maintain their login status
please elaborate
|
|
|
|
|
Yes,Maintain the username in a session,if there is a null value means,I will redirect to login page. There is no prob in that.
What I want is ,if the user suddenly used the window after logged in means how can I capture their status? and how to update the Database?
I updated the Databse for login status in sign out button click and session_end of Global.asax.
There are many pages in my application,after login.So How to update the database when the user suddenly closed the browser window?
|
|
|
|
|
There is one more way
Create a base class that will have a method which check the session if user is logged in or not call that method from page load of base class
Now your page should derived from this base class
Now if user closes the browser you want to sign out user
Create a cookie like person id for the session level and check that cookie
if user close the browser without sign out, then cookie will also get deleted now if he open in new browser the cookie will not be available
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
if the user clear the cookies means how can we maintain the status?
Any other idea? other then this?
|
|
|
|
|
First tell me what problem are you facing when user closes the browser without logged out. And open the application in new browser.
Muthunagai.A wrote: if the user clear the cookies means how can we maintain the status?
If user clears the cookie he will redirect to login page
Muthunagai.A wrote: Any other idea?
No friend, i don't see any other idea as you need to use client side state management for this as server never knows about the browser states whether it is open or closed
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
If the system suddenly hang or shoutdown means,how to maintain the login status?
|
|
|
|
|
Muthunagai.A wrote: If the system suddenly hang
Ya you should not logged out the user but at certain interval of time,
If it exceeds more than 20 min(depends on business ) your session should expired so user need to logged in again.
Muthunagai.A wrote: shoutdown means,how to maintain the login status?
If system get shut down then you should not maintain the status as logged in user. The user should not logged in by default after Restarting the machine. As there should be a new session for that user
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hai,
How to calculate city and country ip address of the system.
|
|
|
|
|
|
Hi
I have a hyperlink field which is in a template field in a gridview
I have given it an ID
However in the c# code behind I cant seem to reference it, why would this be?
I want to be able to control it using the c# code
thnaks!
|
|
|
|
|
Since it is in the gridview, you should use FindControl() method to find the control from an id.
HyperLink hyp = GridView1.Rows[index].FindControl(id) as HyperLink;
|
|
|
|
|
Hi
Should I use [index] or should I put the number of the row in there as it hasnt found the control.
thanks!
|
|
|
|
|
You should put the row index. If you want to find the control from 5th row, index would be 4.
|
|
|
|