|
Hi,
I have developed a web site in asp.net 1.1, but my web site session has expired within 2-4 min, I have set time out 60 mint in web.config and global.asx file.
I have checked many forum but didn't get right solutions.
need your experience;
Thanks
RAJESH
|
|
|
|
|
Check the IIS Settings , there is a place where you set your sessions
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
|
|
|
|
|
Session may expire because of many reasons. IIS settings may cause problems or ASP.NET process recycles may cause problems. Make sure your ASP.NET worker process is not restarting frequently.
|
|
|
|
|
I have intergrated with Active Directory But i wana Give access to Groups in Active Directory...
I dont want HR group to access my page Only IT and other Groups in AD can access...
Can some one help and send me the code...
Login.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.DirectoryServices;
public partial class Login : System.Web.UI.Page
{
public string myEmployeeID;
protected void Page_Load(object sender, EventArgs e)
{
}
private bool Authenticate(string domain, string txtusername, string txtpassword)
{
bool authentic = false;
try
{
DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain,
txtusername, txtpassword);
object nativeObject = entry.NativeObject;
authentic = true;
}
catch (DirectoryServicesCOMException) { }
return authentic;
}
protected void Button1_Click(object sender, EventArgs e)
{
string adPath = ConfigurationSettings.AppSettings["strADPathVar"].ToString(); ;
//Authenticate adAuth = new Authenticate(adPath);
try
{
string strDomain = ConfigurationSettings.AppSettings["strdomainVar"].ToString();
if (true == Authenticate(strDomain, txtusername.Text, txtpassword.Text))
{
string groups = "";
FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, // version
txtusername.Text,
DateTime.Now,
DateTime.Now.AddMinutes(60),
false, groups);
// Now encrypt the ticket.
string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
// Redirect the user to the originally requested page
Response.Redirect(FormsAuthentication.GetRedirectUrl(txtusername.Text, false));
}
else
{
lblError.Text = "Error: Unknown user ID or bad password.";
}
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
cheers
|
|
|
|
|
You can do one thing,
Get the group of every user from AD at the time of authentication and save the same in session.Then you can put the restriction on pages according to the gruoup he/she belongs on different pages.
|
|
|
|
|
Can you make a Code for One of Group in AD???
Im trying but could'nt succeed.........
sheeba
|
|
|
|
|
Post you code then it'll ne better to rectify your issue
|
|
|
|
|
I want to get the data of a row of a grid view through source code
by using a chek box
i m using the following code
<asp:GridView ID="GridView1" runat="server" PageSize="30" AllowPaging="True" BackColor="#FFE0C0" BorderColor="#6d042f" Border="1">
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField >
<HeaderTemplate>
<asp:CheckBox ID="CheckBox2" runat="server" Text="select all" onclick="javascript:SelectAllCheckboxes(this);" ToolTip="click here to checked all checkbox"/>
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#FFF0F7" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E5B9CA" Font-Bold="True" ForeColor="Navy" />
<PagerStyle BackColor="#6D042F" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#6D042F" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#E5B9CA" />
</asp:GridView>
|
|
|
|
|
Why I can't submit a article?
Error :
"
Author IDs need to be integer values. These are the IDs (not the email addresses) of those who will author the article.
Author can not be empty.
"
|
|
|
|
|
If you're too stupid to work this part out, perhaps you should wait a while before writing articles ?
The author id:
- cannot be empty
- is an integer
- is not your email address
It's kind of silly that you're asked to enter this, it should just get it from your login, I'd have thought. But, it's your CP user id. Mine is 6556, for example.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
I am looking for some information on creating a system that will store Form Layouts in a database. I see all kinds of web form creators on the market but I want to try to do it myself so I can customize it to my liking. Does anyone have any links or information on the best way to store the form layout in a database and just have a page get the layout and the submit action from the database and create a web form on the fly. Any help or guidance on this would be appreciated.
|
|
|
|
|
That depends upon what you want to save. If you want to save the flexible layout i.e. position and state then you can use WebParts. If you just want to save colours and fonst (look-n-fell) then just use Themes / Skins. and if you want to save all the things then you can use both.
You can use WebParts.i.e. create a webpart with some property, and asp.net will store all the properties associated with webpart in the sql server database. and it will retrieve and render the webpart according to the user logged in, when you redirect the use to that page.
I forgot ASP.Net Personalization and User Profiles[^].
modified on Monday, February 16, 2009 5:24 PM
|
|
|
|
|
What I am looking for is a way to give users the ability to design forms and save that layout to a database. For instance the user could place a textbox on the form, a checkbox, and a TextArea. I am looking for the best way to save that to a database so that when a user comes to a page and the form ID could be passed in the Querystring the form layout that is saved in the database would be displayed.
I was thinking something like a Forms table that would have the FormID in it an a table that would have the fields in it with the form ID they belong to and the layout of where they belong on the form and such. I see all kinds of Form Builders on the web with the ability to save that form somewhere. I am sure that is in a database somewhere? I just want users to be able to build forms dynamically and save them to a database so I don't have to keep building the forms for them.
|
|
|
|
|
OK. In that case its better to buy some 3rd party tool, because developing such a solution is a long and complex thing. and I have never used such product. so sorry for that...
|
|
|
|
|
|
Hi,
I need to set up a Repeater control that will display summary information on my Webform using C#. I have a stored procedure that selects the Tool_ID, Tool_Name, and Tool_Quantity based on the Category ID that is passed through the session. I need to show the returned information in columns as such:
Tool Id ToolId ToolId
Tool Name Tool Name Tool Name
Tool Quantity Tool Quantity Tool Quantity
Right now this is what I have in my .aspx file:
<asp:content id="Content1" runat="server" contentph="><br mode=" hold=" /><asp:UpdatePanel ID= " upd=" runat=" server="><br mode=" lblcategory="" xmlns:asp="#unknown">
<td>
<asp:repeater runat="server" id="rptToolInfo">
<headertemplate> Summary </headertemplate>
<itemtemplate>
<td>
Tool ID: <asp:label runat="server" id="lblid" text="<%# DataBinder.Eval(" tool_id=")%> /><br mode=" hold=" />Tool:<asp:Label runat=" server=" ID=" lblname=" Text="><![CDATA[<%# DataBinder.Eval("TOOL")%>]]> />
Tool Quantity:<asp:label runat="server" id="lblqty" text="<%# DataBinder.Eval(" tool_quantity=")%> /><br mode=" hold=" /></td><br mode="></asp:label></asp:label></td></itemtemplate></asp:repeater></td></asp:content>
|
|
|
|
|
I would suggest you need to use a pivot table, the best way to do this is to massage your data so it's in this format. If you can't do that, then a repeater is ideal, b/c what you can do is have the repeater creating columns in a table for each item of data.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am using asp:ImageButton control .
I want to associate 3 images with it, for MouseOve, MouseOut and MouseClick events.
How can i achieve this ?
Right now, i m using
<asp:imagebutton id="btnAYes" runat="server" text="Yes" cssclass="btn" oncommand="YesA_Click" imageurl="~/Images/Yes1.png" width="50" xmlns:asp="#unknown" />
Apurv
A man is but the product of his thoughts. What he thinks, he becomes.
.......Mahatma Gandhi
Be the change you want to see in the world.
.......Mahatma Gandhi
|
|
|
|
|
You will need to write javascript to do this, I don't believe the control supports it directly.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
In Page_Load Add
btnAYes.Attributes.Add("onmouseover", "src = 'images/pic1.png'")
btnAYes.Attributes.Add("onmouseout", "src = 'images/pic2.png'")
btnAYes.Attributes.Add("onmouseclick", "src = 'images/pic3.png'")
|
|
|
|
|
why not just put it in the aspx ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Like this you mean:
<img name="img1" src="/images/whatever1.gif" onmouseover="document.images['img1'].src = '/images/whatever2.gif';" onmouseout="document.images['img1'].src = '/images/whatever1.gif';">
I never thought about that until you asked why not.
The other method has always done what I needed.
|
|
|
|
|
Yeah, both ways work, I guess the real question is, when you're maintaining the code, which is the place you're most likely to expect to see this set ? I'd expect that depends on the coder, you're used to looking in one place, I am used to looking in the other.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
For maintaining the code, it's definitely better in the aspx.
But I just remember why I used the other method, i didn't get it to work in the aspx.
And neither did I now.
But I'll have a look into that tomorrow. It's way to late for my brain now.
|
|
|
|