|
|
Thanks for the replies.
Yet I think my question wasn't clear. The directory I need to protect contains pdf files/images, which should be available to logged in users only. And pdf/images in a website can be directly accessed from url. How to restrict their access?
|
|
|
|
|
Sir,
I have to make a liberary management project .Can u please send any link for the project.
Thanks
|
|
|
|
|
go to this url http://www.vbcode.com/
then search for "library" before hitting search button make sure drop down lost says Exact Phrase
you will find lots of samples
|
|
|
|
|
Hi,
Im using an SQLDataSource to get data from an SQL DB. The DataBind is set to occur at Page_Load. In the code behind i need to capture the data as variables. The data returned is for just 1 record, and is set up via the DataSource wizard in VS2005.
How do i get this data into the variable?
At present i'm trying the following code in the Page_Load event:
<code>staffEmail = DataBinder.Eval(Container.DataItem, "staff_Email").ToString();</code>
However this says 'Container' does not exist in the current context. So how do i retrieve this information??
Any help would be appreciated.
Thanks.
|
|
|
|
|
U can use
Eval("staff_Email") directly no need to do DataBinder.Eval
May be it Possible that .net 2.0 is not support Container code. also u dont have to mention tostring() in behind..
Viral....
|
|
|
|
|
I tried that and got the following error:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
Any other suggestions?
|
|
|
|
|
Sorry to reply u late...
Ya you are right it is not going to work. but you can do one thing ---
U can use page_load event of page and write the code some thing like this
=============================================
TextBox1.Text=Ds.Tables[0].Rows[0].ItemArray[1].ToString();
=============================================
it will work and do as you like
it just take little but can helpful.
you just have to creat a dataset or even datatable or even datarow as u like and will work perfact
Viral
|
|
|
|
|
I have two textboxes and want this comparevalidator to do a case insensitive comparision.... is there any workaround?
Thanks in advance
|
|
|
|
|
|
while opening below mentioned web link it says that i am not authorized to view this page. could you please copy paste the contents of this page if possible?
thanks a lot
|
|
|
|
|
|
Ok i was able to open that link but its not what i am looking for. That link only shows the working of compare method. i am looking for comparevalidator control to do case-insensitive comparison.
|
|
|
|
|
http://www.nedcomp.nl/support/origdocs/dotnetsdk/cpref/frlrfsystemstringclasscomparetopic5.htm
copy that link and paste into browsers address bar.
|
|
|
|
|
Hello,
I have a Web.sitemap file. I created a SiteMapDataSource.
Every node on my Web.Sitemap have a property named Visible which is set to true or false.
I need my SiteMapDataSource to get only the nodes from Web.Sitemap which has the property Visible="True".
How can I do this?
Thanks,
Miguel
|
|
|
|
|
You could turn on SecurityTrimming so that you can set which roles can see which items in the Sitemap, then set the ones you want invisible to a non existant role.
|
|
|
|
|
Is not any other solution?
Web.sitemap is basically a XML file.
I supose I could go through each item on the SiteMapDataSource ...
Is is just that roles for this doesnt seem the best way to solve this.
Thanks,
Miguel
|
|
|
|
|
Instead of having a sitemap with Visible property
it's easier to have 2 sitemaps:
1. with visible nodes only
2. with all the nodes
This will allow you to bind the menu control to the visible sitemap
and to get other nodes from the other sitemap
you can configure the names of the 2 sitemap providers in web.config
see this msdn article to know how:
http://msdn2.microsoft.com/en-us/library/ms178426.aspx[^]
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
|
|
|
|
|
Hi,
Are you talking about dependent site maps?
I will explain my problem:
My web site uses two different web site maps:
1. The full one which is used in the menu.
2. The most restricted one which is a part of (1) and that is used in footer links.
3. In both cases I need to have everything in two cultures: English and Portuguese.
Could you give me your opinion of how to create this?
Thanks,
Miguel
|
|
|
|
|
I'm not sure if you can create resource files for sitemaps to localize them.
I had a similar problem before and I had to create a different copy of sitemap for each language.
In your case you will need 4 sitemaps (2 for each langauge) and have some code to decide which sitemap that will be used according to the current culture.
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
|
|
|
|
|
After searching the MSDN I found that you can have resouce files for sitemaps to localize them.
check this page:
http://msdn2.microsoft.com/en-us/library/ms178427.aspx[^]
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
|
|
|
|
|
hi i am creating a asp.net form which includes on text fileld for customer id which is to be auto generated. i got a for auto generation code for customer id, but it is written in vb.net.I want the same code to be written in c#.Can any help to write the code in c#. I have tried to write the same code in c# but it is throwing an error.
I am posting the vb.net code for auto generation.Can any one convert the followin code for me in c#.please it is urgent as i required in my project.
Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
' Following is the code for auto generating the costomer id
Dim ctr As Integer
Dim len As Integer
Dim custid As String
Dim custidval As String
dt = Dscust1.Tables("customertracking")
len = (dt.Rows.Count - 1)
dr = dt.Rows(len)
custid = dr("custid")
custidval = Mid(custid, 2, 3)
ctr = CInt(custidval)
If ctr >= 1 And ctr < 9 Then
ctr = ctr + 1
txtcustid.Text = "c00" & ctr
ElseIf ctr >= 9 And ctr < 99 Then
ctr = ctr + 1
txtcustid.Text = "c0" & ctr
ElseIf ctr >= 99 Then
ctr = ctr + 1
txtcustid.Text = "c" & ctr
End If
txtcustid.Enabled = False
End Sub
Pranav Dave
|
|
|
|
|
if customer id is an integer value then why would you want it to create like this.
database can create you an id and have it increased by 1 for each data insertion.
why dont you let the database take care of this
|
|
|
|
|
The following was produced with our Instant C# VB to C# converter:
//TODO: INSTANT C# TODO TASK: Insert the following converted event handlers at the end of the 'InitializeComponent' method for forms or into a constructor for other classes:
btnadd.Click += new System.EventHandler(btnadd_Click);
private void btnadd_Click(object sender, System.EventArgs e)
{
// Following is the code for auto generating the costomer id
int ctr = 0;
int len = 0;
string custid = null;
string custidval = null;
dt = Dscust1.Tables["customertracking"];
len = (dt.Rows.Count - 1);
dr = dt.Rows[len];
custid = dr("custid");
custidval = custid.Substring(1, 3);
ctr = System.Convert.ToInt32(custidval);
if (ctr >= 1 & ctr < 9)
{
ctr = ctr + 1;
txtcustid.Text = "c00" + ctr;
}
else if (ctr >= 9 & ctr < 99)
{
ctr = ctr + 1;
txtcustid.Text = "c0" + ctr;
}
else if (ctr >= 99)
{
ctr = ctr + 1;
txtcustid.Text = "c" + ctr;
}
txtcustid.Enabled = false;
}
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
hi,
I have a user control for registration of user. Now i need to submit the fields with ajax method in database. When insertion is completed successfully,
need to load other control by a javascript function in the same page with success message.
for e.g.
page1.ascx
function insert()
{
var message = insertdata(); // insertdata is an ajax method.
//load other control on this page with above message displaying on that control with some label control or literal control
}
any help is appreciated,
regards,
max
|
|
|
|