|
I am not finding "provider" section in web.config file
|
|
|
|
|
You need to override the default complexity requirement (residing in the machine.config) by adding the following code to your web.config file. Then change the values to fit your preferences:
<membership>
<providers>
<remove name="AspNetSqlMembershipProvider" />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="false"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
Lars Brandt MCP/C#
|
|
|
|
|
Thank you so much for the help.it is working great.
bye
valli
|
|
|
|
|
hi my friends,
i have some html pages, that pages are work according to userquery string.
if id=1 then 1.hmtl is coming.
Question is that:
how i can set that on an page with web user control (acsx)?
or any option?
Thanks
|
|
|
|
|
By putting the content in user controls and then putting those controls inside one control that decides which inner control to show based on the querystring/
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I just start learning to write web service using C# vs 2005 - I have a question about passing objects between client and web service.
I have a simple XML, I call it ValueTable.xml
<?xml version="1.0" encoding="utf-8"?>
<ValueTable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="TableA">
<Table>
<Table_rec>
<date>
<cal_date>01/22/08</cal_date>
<weekday>Y</weekday>
</date>
<value>198700</value>
</Table_rec>
<Table_rec>
<date>
<cal_date>01/22/08</cal_date>
<weekday>Y</weekday>
</date>
<value>25500</value>
</Table_rec>
</Table>
</ValueTable>
I ran
xsd valueTable.xml
xsd /n:TableA /c valueTable.xsd
Then I added valueTable.cs generated in my web service project and create a web method -
[WebMethod]
public ValueTable HelloWorld2()
{
ValueTable t1 = new ValueTable();
XmlSerializer si = new XmlSerializer(typeof(ValueTable));
TextReader r = new StreamReader("f:\\ValueTable.xml");
t1 = (ValueTable)si.Deserialize(r);
r.Close();
return t1;
}
I saved the wsdl in my localhost default directory and create a client winform project.
Add the web reference by adding the wsdl and call Helloworld2
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
localhost.Service ls = new localhost.Service();
localhost.HelloWorld2ResultTableTable_rec[][] vt = new ConsoleApplication2.localhost.HelloWorld2ResultTableTable_rec[10][];
vt = ls.HelloWorld2();
}
}
}
vt populates what I expect to see - good (though I am not sure I am doing it the right way).
but say if I want to change HelloWorld2 to be
public ValueTable HelloWorld2(ValueTable Tablein)
by adding an input parameter, for simplicity reason same type of object as the return,
I struggle to get it work. How can I use the info in the wsdl(only)to serialize a ValueTable oject? Do I need to add the same .cs as i did in the server? (does not sound right). Any links or help is appreciated.
|
|
|
|
|
ok, I think I got a problem with decorating, should be fine now, later.
Thanks
|
|
|
|
|
Hi Everybody,
I need to store a datatable in my page (To bind a grid again after Sorting To be precised)
At present I am storing it in viewstate
My question is will it better to store it in session rather than ViewState(As that Datatable is quite big the page may become quite heavy)???
|
|
|
|
|
Yes, I will suggest you to store data table in Session , rather than View State as you data size is quite big.
Any way you can check one of my article on view state
Beginner's Guide to View State[^]
And don't forget to read Discussion Section [ViewState Vs Session ]
cheers,
Abhijit
|
|
|
|
|
hi Abhijit,
read the article ...
good one
thanx
|
|
|
|
|
Your best bet if it's big is to store the ids needed to build it, on the URL perhaps, and then get the data from the DB as needed. keeping viewstate down is a good thing, but using the session too much is also a bad move.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Nishant
Session v/s Viewstate is quite a good question, but you need to consider two things before you make up your mind.
1. How long you want to retain the DataTable in Memory. i.e. if your site is hosted on shared server then you cannot hold it for more than a 5-10 mins as the services restart and the session is destroyed. So in this case the viewstate is better option. But if you are having dedicated server then opt for session.
2. Why not XML. Create a XML of datatable with unique name, write it to disk and then save the file name in ViewState. You will save both the ViewState and session memory.
|
|
|
|
|
Hi,
Can anyone give me an useful link for form authentication using asp.net 2.0
Thanks
|
|
|
|
|
|
Hi,
here is the code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
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;
public partial class MainCategory : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int y = Convert.ToInt32(Request.QueryString["menu_id"]);
string z = (Request.QueryString["menu_text"]);
string v1 = z.ToUpper();
v1 = v1.Replace(" ", "");
getid();
SqlConnection con = new SqlConnection("Server=.; Database=eclsc; Trusted_Connection=yes");
SqlDataAdapter sda = new SqlDataAdapter("select top 1 "+v1+".image, ID.category_name from "+v1+", ID where where parent_id='"+test1+"' ", con);
DataTable dt = new DataTable();
con.Open();
sda.Fill(dt);
DataView dview = dt.DefaultView;
DataList1.DataSource = dview;
DataList1.DataBind();
con.Close();
}
public void getid()
{
int y = Convert.ToInt32(Request.QueryString["menu_id"]);
SqlConnection con = new SqlConnection("Server=.; Database=eclsc; Trusted_Connection=yes");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = " select category_id from ID where menuindex='" + y + "' ";
con.Open();
string test1 = cmd.ExecuteScalar().ToString();
con.Close();
}
the error is :test1 is not in current context.I want it in page load
|
|
|
|
|
Its seems , you didn't understand your last answer that what other people given.
just do it using View State.
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if(ViewState["TestVal"] !=null )<br />
<br />
{<br />
}<br />
else<br />
{<br />
string test=ViewState["TestVal"]<br />
<br />
}<br />
}
public void getid()
{
int y = Convert.ToInt32(Request.QueryString["menu_id"]);
SqlConnection con = new SqlConnection("Server=.; Database=eclsc; Trusted_Connection=yes");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = " select category_id from ID where menuindex='" + y + "' ";
con.Open();
string test1 = cmd.ExecuteScalar().ToString();
ViewState["TestVal"]=test1;
con.Close();
}
cheers,
Abhijit
|
|
|
|
|
Please, dear God, tell me no-one is paying for this code.
R1119 wrote: int y = Convert.ToInt32(Request.QueryString["menu_id"]);
This is retarded. Your page will blow up if someone puts a non number on the URL.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: R1119 wrote:
int y = Convert.ToInt32(Request.QueryString["menu_id"]);
-------------------------
Merry Christmas Boss !!
cheers,
Abhijit
|
|
|
|
|
Merry Christmas, have a good one.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
return the value of test1 from getid();
public string getid()
{
int y = Convert.ToInt32(Request.QueryString["menu_id"]);
SqlConnection con = new SqlConnection("Server=.; Database=eclsc; Trusted_Connection=yes");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = " select category_id from ID where menuindex='" + y + "' ";
con.Open();
string test1 = cmd.ExecuteScalar().ToString();
con.Close();
return test1;
}
and on page load use
string test1=getid();
SqlConnection con = new SqlConnection("Server=.; Database=eclsc; Trusted_Connection=yes");
SqlDataAdapter sda = new SqlDataAdapter("select top 1 "+v1+".image, ID.category_name from "+v1+", ID where where parent_id='"+test1+"' ", con);
DataTable dt = new DataTable();
con.Open();
sda.Fill(dt);
as simple as that
|
|
|
|
|
Hi to all,
I created a method outside the page_load.
Now I want the value of that variable which is defined in the method, in Page_load.
thanks.....
|
|
|
|
|
either make that Variable Global .....or store it in some Hidden Field
|
|
|
|
|
if you are trying to get value in same request then declare member as class level. if you are trying to get value after postbacks try using viewstate.
|
|
|
|
|
|
I hv attached the code
window.open(urlstring,'ReportSearch','height=480,width=640,titlebar=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
i hv called the code in the button click
|
|
|
|