|
If you want to specify page or full folder that don't need to be authenticated, use <location> tag in web.config.
For example
<location path="yourFoldername">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
The <b>path </b>attribute can be used to identify a specific file or child directory to which unique configuration settings apply.
|
|
|
|
|
Thanks buddy!!
I will try this one. I hope this is what I was looking for
|
|
|
|
|
I want to access the repeater dataitems from server code like this:
Repeater1.DataSource = List1; //List1 is a list of Class1 objects
Repeater1.DataBind();
foreach(RepeaterItem item in Repeater1)
{
Label.Text = ((Class1)item.DataItem).Prop1.ToString();
}
When I run it, it seems like the DataItem is null
|
|
|
|
|
You do this in the item data bound event.
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.
|
|
|
|
|
Use ItemDataBound event to get the DataItems.
use e.Item.DataItem
|
|
|
|
|
Hi,
I want to know if it's possible to get rounded corners border,
for example:
<asp:Panel runat="server" ID="pnl" BorderStyle="solid" BorderColor="black" BorderWidth="2px">
some text...<br/><br/>
</asp:Panel>
<ajaxToolkit:RoundedCornersExtender ID="rce" runat="server"
TargetControlID="pnl"
Radius="6"
Corners="All" />
I tryed it, but I dont get rounded corners
|
|
|
|
|
Try this code, you will have the idea abt this control...
<asp:Panel ID="pn1" runat="server" BorderWidth="2" BorderColor="Red"
BorderStyle="Solid">
Some Text here</asp:Panel>
<ajaxToolkit:RoundedCornersExtender ID="roundecorner" runat="server" TargetControlID="pn1"
Radius="20" Corners="All" Color="Green">
</ajaxToolkit:RoundedCornersExtender>
Hope this will help u....
|
|
|
|
|
not what I'm looking for...
I'll be more specific...
The background of the panel has to be a picture(with repeat-x) and the picture's top is white, so I have to define a border in order to make it looking good...
here is a picture of the wanted result:
http://img269.imageshack.us/img269/8530/eampn.png[^]
|
|
|
|
|
dirs = Directory.GetDirectories(path);
foreach (string dir in dirs)
{
string dirName = dir.Substring(dir.LastIndexOf("\\") + 1);
TreeNode child = new TreeNode();
child.Text = dirName;
child.Value = "";
child.PopulateOnDemand = false;
child.Collapse();
child.ImageUrl = "/images/dir.jpg";
node.ChildNodes.Add(child);
////////
filess = Directory.GetFiles(dir.ToString());
......
}
i wrote this code for get files and directory from a path e.x. when i write (path = d:\\programfile) i can list the directory and files, but now
i want get field and folders that there is in ftp path e.x. when i write (path=ftp://192.168.0.9 or path = ftp://myftp) i can list the directories and files that there is that path. is it possible? how can i do? is there any body help me or can u give me a sample
|
|
|
|
|
What does this have to do with ASP.NET ?
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 found this example from msdn:
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://192.168.0.9/");
request.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
// This example assumes the FTP site uses anonymous logon.
request.Credentials = new NetworkCredential("anonymous", "janeDoe@contoso.com");
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);
Console.WriteLine(reader.ReadToEnd());
Console.WriteLine("Directory List Complete, status {0}", response.StatusDescription);
reader.Close();
response.Close();
when i write it in consoleApplication it is right, but now i want write it in webApplication and show the output in tree can u help me?
|
|
|
|
|
OK, so your question now is, how do you show the result of this call in a tree ? You will need to parse reader.ReadToEnd(), and then you will need to take that data and put it into your tree structure.
Why would you write a website which supports FTP like this ? You're going to let users move data to and from your server ?
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.
|
|
|
|
|
WebRequestMethods.Ftp might help you out. See this[^] stricle here at CP.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
i m using MultiView and view controls on single asp.net2.0 page. i have place my image buttons inside the view controls which are upto 130 buttons. when i place some more image buttons it show this error in he Exception of type " System.OutOfMemoryException" was thrown. i don't know whats problem. please help me to handle this problem
thanks
|
|
|
|
|
Saif-ur-Rehman Tanoli wrote: type " System.OutOfMemoryException" was thrown
Its very difficult to tell the details of the error with out much knowing about your application. The cause is Memory.
Where is your application hosted?
Which session mode are you using?
Is there any larger data in Session?
Are you tried to downloading larger number of image?
Please Read This Article for More Information[^]
|
|
|
|
|
thanks for reply.
actually i m using view control to show separate page.
for example
when home button clicked
void btn_home_clicked( )
{
MultiView1.SetActiveView(Home);
}
i have added all features required by homepage in home view control and similarly all other pages are filled in this way. now as i m handling all pages(home,jobs,sale,etc) in a singe Multiview control. suppose i want to add some more control on jobs view when i drag and drop control there it will add an error tag there. with message
Exception Type "Ssytem.OutOfMemory" Exception was thrown.
i hope now you understand problem
|
|
|
|
|
System.OutOfMemoryException occurs when server side memory is exhausted. See if there is some recursive calls available... which runs infinitely. Remove if you find one..
Other than that, you need to use your resources properly while creating response.
|
|
|
|
|
Hi guys,
I want to display the selected item in a dropdownlist when I select it !!!
there's only one available, but i doesn't seem to work !!!
I use :
DDL.SelectedItem.Value.ToString()
I think I should use postback here but dunno how !
|
|
|
|
|
Enable AutoPostback For DropDown List
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>a</asp:ListItem>
<asp:ListItem>b</asp:ListItem>
<asp:ListItem>c</asp:ListItem>
</asp:DropDownList>
|
|
|
|
|
As far as I know Using session for so many variables makes the web-page performance lower. However I am not sure what to use instead of it. There are some important information that I do not want to pass thru querystring such as UserID etc.
Do you have a better idea?
|
|
|
|
|
Session should be fine for storing something like a UserID, it shouldn't cause significant degradation in performance. However, if you are also using Session state to store things like DataTables or other large amounts of information, I'd rethink the design.
only two letters away from being an asset
|
|
|
|
|
I am completely agree with Mark, Use of session depends of what kind of data you want to store. UserID or some UserInformation. But try to avoid store large amount of data inside data.
Here is one of my article on Session, which may help you
Exploring Session in ASP.NET
|
|
|
|
|
Session are very good when used corretly not abused and as the other guys said, you can use it to store UserID or other type of data that you want to use across pages. well i have seen Sessions being abused , when someone try to store a dataset in a session variable. in that case you will come across a problem with peromance.
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.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hello I am trying to return a value thru viewstate. However the code below gives nullreference problem. Can not Viewstate be used at pre_init event?
protected void Page_PreInit(object sender, EventArgs e)
{
if (!IsPostBack)
{
con = u.getconnection();
con.Open();
cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "usp_UserMenuCount";
prmUserID = u.prm("@UserID", ParameterDirection.Input, SqlDbType.BigInt, 8, "1"/* Session["UserID"].ToString()*/); con = new SqlConnection();
prmCount = u.prm("@Count", ParameterDirection.Output, SqlDbType.Int, 8, "farketmez"/* Session["UserID"].ToString()*/); con = new SqlConnection();
cmd.Parameters.Add(prmUserID);
cmd.Parameters.Add(prmCount);
cmd.ExecuteNonQuery();
lb_Count = int.Parse(cmd.Parameters["@Count"].Value.ToString());
ViewState.Add("id", int.Parse(cmd.Parameters["@Count"].Value.ToString()));
}
else { lb_Count = int.Parse(ViewState["id"].ToString()); }
|
|
|
|
|
Ersan Ercek wrote: However the code below gives nullreference problem. Can not Viewstate be used at pre_init event?
Yes. This is Correct.
Because ViewState Data Load Just Before the Page_Load Event. So, if you are accessing ViewState in Pre_Init() it will not be initialize. Because LoadViewState() comes a later stage in ASP.NET Page life cycle .
|
|
|
|