|
On the buttonclick where you are transferring the user to another page.Pass the id in querystring as showtour.aspx?tourid=1 .
Now read this id at pageload on showtour.aspx as Request.QueryString["tourid"] and load the details for this ID.
|
|
|
|
|
thanks.
sorry for the lack of knowledge in this issue.
how can i load the details for this ID in the detailsview control i have on the second page showtour.aspx?
|
|
|
|
|
See, you need to read the ID from querystring, not get the details of the tour from DB fro this ID and show the detail using You detailsveiw control.
If you have problem is using detailsview control,the look at the following links
Link 1
Link 2
|
|
|
|
|
Hi
I have a radiobuttonlist control on my control, where the datasource is a collection, and I am using the DataTextFormatString to set the text field to a hyperlink. All this bit works, but where I am struggling to work is to add to the url path the value from the datavaluefield. Nothing I try works! Does anyone know how to set the datavaluefield into the url? Further, and one last question, my radiobuttonlist control is in a wizard step, and when the user clicks on a hyperlink, I want it to go on to the next step, all that is happening is that the link is going back to the first step. How do I correct this?
|
|
|
|
|
Hi
I have problem with my CSS where are all styles are saved to CSS file, which I link to in my master page. On my web content page, which inherits my master page, I have a number of user controls on my content page. However, the problem I have is that my tags are not applying the CSS, and I don't understand why! For example, I have a number of div tags which have display property set on them to block. Using Javascript I then change to the setting to none in order to show and hide the div tag. Adding an alert message box, and checking the div tag, the CSS property is not set then though I have applied the style via the class property of the tag. When I apply the CSS using the style proprty everything works! This is not how I want to set my CSS because my coding standard is to use the CSS file and set it via the class property. Can some explain to me why this is happening and how to fix it?
|
|
|
|
|
|
hi everybody
my problem with gridview
I create gridview like this
//...................................
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False"
="" width="108px">
<columns>
<asp:templatefield headertext="From">
<itemtemplate>
<asp:label id="Label4" runat="server" text="Account No :">
| <asp:textbox id="TxtAccNo" runat="server">
| <asp:label id="Label5" runat="server" text="Amount :">
| <asp:textbox id="TxtAccAmo" runat="server">
|
//.............................................
and in the below I have tow textbox and add button
I want when click on add button the value of the tow textbox adding/inserting
into the gridview (I want to add more than one value)
how can I make that and
thanks
|
|
|
|
|
1:Add textbox items in dataTable
2:Save dataTable in Session
3:Set GridView datasource as dataTable from Session
check this sample code
protected void Button1_Click(object sender, EventArgs e)
{
DataTable dt;
DataRow drow;
if (Session["datatable"] == null)
{
dt = new DataTable();
DataColumn dcol = new DataColumn("Column1", typeof(string));
dt.Columns.Add(dcol);
int rowcount = 0;
drow = dt.NewRow();
dt.Rows.Add(drow);
dt.Rows[rowcount][dcol] = TextBox1.Text;
Session.Add("datatable", dt);
}
else
{
dt = (DataTable)Session["datatable"];
drow = dt.NewRow();
dt.Rows.Add(drow);
dt.Rows[dt.Rows.Count-1]["Column1"] = TextBox1.Text;
Session.Add("datatable", dt);
}
GridView1.DataSource = dt;
GridView1.DataBind();
}
makhaai
modified on Thursday, June 10, 2010 5:06 PM
|
|
|
|
|
in fact I want my site admin able to create new language in his adminpanel.
is there any simple way?
thanks
mehran
|
|
|
|
|
I am not sure but, you can provide an interface where your admin user can provide the resource value and using ResourceWriter class you can achieve this.
System.Resources.ResourceWriter rw = new System.Resources.ResourceWriter("English.resources");
rw.AddResource("ResourceKey", "Value");
rw.Generate();
rw.Close();
WWW, WCF, WWF, WPF, WFC .... WTF
|
|
|
|
|
I have create a website that has a Login.aspx page, a Default.aspx page and a DoSomething.aspx page.
I have configured forms authentication in Web.config (pretty standard implementation) as follows:
<authentication mode="Forms">
<forms loginUrl="Login.aspx"
protection="All"
timeout="10"
name=".ASPXAUTH"
path="/"
requireSSL="false"
slidingExpiration="true"
defaultUrl="Login.aspx"
cookieless="UseDeviceProfile"
enableCrossAppRedirects="false" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
When I run the website *without* Forms Authentication Login.aspx loads fine.
When I run the website *with* Forms Authentication Login.aspx doesn't load any images or apply any styles referenced in the css files.
Does this behavior sound familiar to anyone? What's the fix for this?
|
|
|
|
|
You should allow loading images and styles to unauthorized users, this is a typical prcactice.
By default, ASP.NET will require authorization for all files, including images. Something like:
<location path="Images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="css">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
Die Energie der Welt ist konstant. Die Entropie der Welt strebt einem Maximum zu.
|
|
|
|
|
Thanks! I'll try that.
I don't think it was done that way in 1.1 was it?
|
|
|
|
|
Ohhh, I really don't remember how it was in 1.1
1.1 was soooooo long ago..
Die Energie der Welt ist konstant. Die Entropie der Welt strebt einem Maximum zu.
|
|
|
|
|
Ok - I put the following config sections in my Web.config but I'm still getting the same behavior:
<location path="images">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
<location path="css">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
I tried: allow users="*" but it didn't work so I figured I'd try: allow users="?" since the images on the Login page will need to be displayed for unauthenticated users.
The structure under my website is ./resources/images/myimage.jpg with a similar structure for the css directory.
.NET wouldn't let me specify a path starting with "." or "/" or ending with "/" so I ended up using the config sections above. However, the images and styles still aren't displaying.
|
|
|
|
|
No, you need "*", not "?". "*" is any user, including anonymous. "?" is anonymous.
If the structure of your site is resources/images/myimage.jpg , you should add
<location path="resources/images">
Also, read about location element:
http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx[^]
Die Energie der Welt ist konstant. Die Entropie der Welt strebt einem Maximum zu.
|
|
|
|
|
|
I have problem with uploading image to sql database.. In asp.net form i use this input
<br />
<Input ID="MyFile" Type="File" RunAt="Server" onclick="return MyFile_onclick()" /><br />
On database i have atribute in table defined as image. What do i have to insert now to this table,this atribute(named pics) that i could load image from database and displayed it in page? Do i have to make separate table, where i need to insert image title, image size, image type? I tryed with inserting MyFile.Value into table atribute(type image) but it didn't work!!
In form i have also imagebox. How to display selected image from MyFile in this imagebox?
Thanks
|
|
|
|
|
|
Ok i have looked at article..i understand how it works, but when i used it with asp.net application i didn't get full path of file to use it in stream. I tryed both asp:fileupload and input type="file" with PostedFile.FileName and nothing retrieves full path. Everytime i get error that selected picture wasn't found in C:\\windows\\system32\\filename.
I tryed to saved it there, but then i get error for reading rights..
Any idea how to deal with this.?
|
|
|
|
|
Hi..
I m working on a web application where I have simple structure.
I have root directory and a secure directory.
root directory have pages which all users can request, and secure directory will be accessible to users who are authenticated. ( I dont need roles as i will have only one type of users)..
can you tell me how to proceed for authentication..
thanks,
By:
Hemant Thaker
|
|
|
|
|
There are several different ways to accomplish this; what have you tried so far?
If your users have to log in you should be able to create some logic which tests for that and redirects or allows through as appropriate. How are you managing the users?
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
Hi.. thanks,
I am storing users in database. only username and pwd.
Once user is logged in certain links will appear ( links for secured pages).
so I want , only valid users can request these pages..
I simply want to stop someone directly using Urls in address bar for these secured pages..
thanks,
By:
Hemant Thaker
|
|
|
|
|
One way would be to create an attribute that would test to see if the current user is logged in/valid. If not, then redirect to another page. You would create the attribute and then decorate the page class; see the tutorial or fond one more suitable.
Attributes Tutorial[^]
This is just one way and it may not be the best for you (or anyone, for that matter). Do some more research and see what else you can come up with on your own, try it and then come back when you get really stuck.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
Hi.
I am storing username to a session["userid"] variable, once the user logged in.
How about checking the session value on the page_load of all secured pages.
and if dont find the value redirect to "custom_page"
thanks
By:
Hemant Thaker
|
|
|
|