|
Mark Nischalke wrote: You can mix them. Use the standard ASP.NET login controls and handle the authentication request on your own. You can use AD to authenticate or some other credential system.
Hello Mark,
if i understood correct.
1. The IIS is configured with "Integration Windows authentication"
2. I have created a standard ASP.NET login control.
In the web.config the setting authentication = "Forms" and i have a Login and a Default URL defined.
I added a new Provider: System.Web.Security.ActiveDirectoryMembershipProvider with the connection string to my Active Directory.
In the default.aspx i check if the User.Identity.IsAuthenticated if yes a lot of settings was set.
So now have the user the possibility to logout. If the user click to logout i to the following
"FormsAuthentication.SignOut() and Response.Redirect("tomylogin.aspx")"
In the "tomylogin.aspx" the stanard ASP.NET login control exists. If the user inserting User and Passwort and click on logon the figures was checked because of the settings in the web.config (Active Directory String....). Is the user authenticatet a redirect to my default.aspx was execute.
My problem now is
1. the first check with the Active Directory is very very slow (i think we have to much users and structurs in the ADS).
2. Is this the correct way for a logout and login to my intranetpage?
3. Can i handle this easier?
Thanks for your help.
best regards
gitschi
|
|
|
|
|
|
Mark Nischalke wrote: Try looking here; How To: Use Forms Authentication with Active Director
Hello Mark,
this article helps me.
Thanks for your answer.
best regards
Gitschi
|
|
|
|
|
hiii
i have created textbox dynamically.
i want to submit the values of this dynamic textbox on button click.
i have written the code but as soon as i click on button the control get lost and no value get submitted in database.When i called createcontrol function on ispostback property at page load it creates
the controls twice.shud i use viewstate for this and how.plz guide.
|
|
|
|
|
mylogics wrote: i have created textbox dynamically.
i want to submit the values of this dynamic textbox on button click.
The control which you are creating dynamically, you need to created before Page_Load() , other wise, it will not able to maintain the View State Data or will not load the Postback Data.
If you deeply look inside ASP.NET Page Life Cycle, Before Page_Load(), there are two different methods calls. 1) LoadViewState() and 2)LoadPostbackData() .
So, if you create any control on Page_Load() , or after that it will not able to load the data.
So you need to create such control either in Pre_Init() or Init() method.
Though there are workaround to add the Control which are created after page_load into Control Tree for maintaining viewstate and Postback, using Catch up . I am not discussing that over here.
Hope this will help you in longer run
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Use Page_Init or OnInit for adding dynamic control otherwise you need to manually maintain the view state.
|
|
|
|
|
mm workin on .net 2.0 which does not support pageinit event.
is there any other way...
|
|
|
|
|
mylogics wrote: mm workin on .net 2.0 which does not support pageinit event.
In ASP.NET 2.0 you can use Page_Init or can override OnInit.
|
|
|
|
|
you seem a little thick. You are posting the same question day after day. Day after day, you get the same answer, which assumes that you're using .NET 3.5. You know you're not, so you need to make that clear. In any case, every day, you're being given the same information. Are you just blindly asking this day after day, without ever writing any code ? Post the code you've written, so we can help you progressively, instead of people giving you the same answer, every day.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi all,
In my gridview i have to select as well as update for which am using two link btns,am using a sr_no as the datakeyname and when i write string s = GridView1.SelectedValue.ToString(); for getting the sr_no it works fine in the selected index changed but i cannot get the sr_no when am using it for updation in the
gridview1_rowupdating() event ...
is there any way i can get the selected value of the gridview as it is important that i have 2 buttons in the gridview
.
|
|
|
|
|
try this,
gvwName.DataKeys[e.RowIndex].Value
|
|
|
|
|
|
Flavia A wrote: Thanks it worked
|
|
|
|
|
I am using this code FileUpload2.PostedFile.SaveAs(Server.MapPath("~\\Images\\") + "Image" + txtRefNumber.Text + ".jpg"); to save images in host but it doesn't save image on host.
|
|
|
|
|
fattycode wrote: to save images in host but it doesn't save image on host.
What does it mean ? Are you getting any error ? or what ?
You are talking about Hosting on IIS or Running your Application From Visual Studio ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I have my webproject in host and i had problem with premissions,I made premission changes on control panel and now is working good.
Thanks for your time.
|
|
|
|
|
fattycode wrote: I made premission changes on control panel
Yes ! That's why I asked you the question, what is the problem if you are hosting on server, you have to give Write Access permission to that folder where you are uploadinf the file.
fattycode wrote: now is working good.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi am quite new to programming and am trying my hands on some codes i copied from the net but am facing these problems
"
Error 1 Program 'C:\Users\Nancy\Documents\Visual Studio 2008\Projects\softwaree\softwaree\obj\Debug\softwaree.exe' has more than one entry point defined: 'softwaree.Program.Main()'. Compile with /main to specify the type that contains the entry point. C:\Users\Nancy\Documents\Visual Studio 2008\Projects\softwaree\softwaree\Program.cs 14 21 softwaree
AND
Error 2 Program 'C:\Users\Nancy\Documents\Visual Studio 2008\Projects\softwaree\softwaree\obj\Debug\softwaree.exe' has more than one entry point defined: 'softwaree.Form2.Main()'. Compile with /main to specify the type that contains the entry point. C:\Users\Nancy\Documents\Visual Studio 2008\Projects\softwaree\softwaree\Form2.cs 53 17 softwaree
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace softwaree
{
public partial class Form2 : Form
{
SqlConnection cn = new SqlConnection("data source=.;database=biblio;uid=admin;pwd=pw");
SqlDataAdapter da = new SqlDataAdapter();
string strSQL = "Select Title, PubID from Titles";
SqlCommand cmd;
SqlDataReader Dr;
System.Windows.Forms.Button Button2 = new System.Windows.Forms.Button();
System.Windows.Forms.ListBox ListBox2 = new System.Windows.Forms.ListBox();
System.Windows.Forms.TextBox TextBox2 = new System.Windows.Forms.TextBox();
public Form2()
{
cmd = new SqlCommand(strSQL, cn);
this.SuspendLayout();
this.Button2.Location = new System.Drawing.Point(136, 248);
this.Button2.Size = new System.Drawing.Size(144, 32);
this.Button2.Text = "Get Data";
this.Button2.Click += new System.EventHandler(this.Button1_Click);
this.ListBox2.Location = new System.Drawing.Point(48, 64);
this.ListBox2.Size = new System.Drawing.Size(312, 160);
this.TextBox2.Location = new System.Drawing.Point(48, 24);
this.TextBox2.Size = new System.Drawing.Size(328, 20);
this.TextBox2.Text = "Hit";
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(408, 293);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.Button2,
this.ListBox2,
this.TextBox2});
this.ResumeLayout(false);
}
[STAThread]
static void Main() {
Application.Run(new Form2());
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
cn.Open();
cmd.CommandText = strSQL + "'" + TextBox1.Text + "%'";
Dr = cmd.ExecuteReader();
ListBox1.Items.Clear();
ListBox1.BeginUpdate();
while (Dr.Read()){
ListBox1.Items.Add(Dr.GetString(0) + " - " + Dr.GetInt32(1).ToString());
}
ListBox1.EndUpdate();
Dr.Close();
}
}
}
|
|
|
|
|
Always rememebr this rule of thumb:
Everyapplication can have one and only one Main function.
Search in your code, it looks that there are multiple main functions are defined.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
This has nothing at all to do with ASP.NET. You want the C# forum. You should work through a basic book rather than trying to copy code off the web.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I have a dataset in which is data is comming from two table coresponding id
ad = new SqlDataAdapter("select cityid,cityname,stdcode,statename from cities,States where cities.stateid=states.stateid", con.cn);
ad.fill(ds,"Temp");
GridView1.DataSource =ds.Tables["Temp");
GridView1.DataBind();
but Right now I Want to filter dataset according to textbox value Colmun Wise who will enter by user.
we can filter data directly from table but I want to filter data from dataset. give me help or sugesstion. Thnks.....
|
|
|
|
|
|
It is not working. there are more than one textboxes and user can enter value more than one textboxes according to colmuns
|
|
|
|
|
You can change filter expression for Select of dataset as per our values.
|
|
|
|
|
But it is giving error object refrence is no set an instance in secondline while colmun is ok and also creare memory for dataset
DataRow[] R;
R =ds.Tables["tmp"].Select("cityname ='" + TextBox6.Text + "'");//Error
GridView1.DataSource = R;
GridView1.DataBind();
|
|
|
|