|
|
Hi,
I have a ASP.NET 1.1 application in which there are pages to add/update records. The problem is that when pages are loaded they are being stored in browser cache. Users are able to load them from their cache and perform add operations. So i require two solutions.
a) These pages should not be stored in cache without touching client browser settings, as i can currently change their settings to get new page every time but this is not acceptable.
b) If thats not possible, then how can i detect whether they have clicked the add button using original page and not cached page.
Regards
Shajeel
|
|
|
|
|
|
You can do as Michael said or you can use the following code in the code-behind to do the same.
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Regards - J O H N -
|
|
|
|
|
thank you both of you
Regards
Shajeel
|
|
|
|
|
When i create a new project in a location which i given, tghe solution file is saving in a default location C:\Documents and Settings\yesuprakash\My Documents\Visual Studio 2005\Projects\...
the other files are saved in the location which i given.
How can i save all files in a same folder.
Thanks and Regards
Yesuprakash
|
|
|
|
|
You can change the default location for saving .sln file.. Tool => Options => Projects and Solution => General => Visual studio project location..
Actually, it's not really a big problem.. You can manually "save as" the .sln in the location that you want. Another thing is that .sln is not very important for web project because you can open the webproject directly from the File-system in VS 2005.
|
|
|
|
|
i have a question ???????
i have 4 html button in my home page with one default active one
when i choose any other button it become the active one and display a certain photo
but when i make refresh to the page it reloads with the default button as the active one ignoring the last choise which i have made
i want the page to be reloaded with the last choise button not the default button
how can i do that ????????
i hope that my question is clear
Thanks ,
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
You have to store the selection somewhere, like a cookie, or your database. Then you have to read the value and change your page to reflect the choice.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
ok the choise happend on client side the server has no idea about it so i need by using java script to creat a cooki and save the user choise in it and send it to the server how can i create cooki by using java script
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
Hi all, I promise I've tried to avoid adding chatter here by doing my home work, but am kind of perplexed. I have come to the conclusion that Master Pages are not at all what I thought they were, but don't want to abandon them in the event I am wrong.
I have a large 1.1 site that I have been putting off migrating for too long, it consists of a wrapper page, default.aspx, which is primarily made up of menus (as well as home page type stuff) and an iframe object that takes up most of the real estate. That iframe displays the approximately 130 individual pages of the application, whose navigation is driven by the menus and submenus surrounding the iframe (with some cross-child page navigation as well).
It works well except for a few very unelegant methods of having my “child” pages interact with the “parent” (default.aspx). So, I am looking at Master Pages. But, as best as I can tell, this is not really their purpose or even the concept. I obviously need for a single contentholder control to be able to cycle between 130 different content pages. I’ve not seen one article written by MS or the experts that even hint at doing that, and no users writing for help that have mentioned such a problem.
Advice is appreciated, I have been playing around with making them work anyway, and already encountered some odd behavior, but I will spare you commentary on that for now.
Thank you for your time,
nowensone.
|
|
|
|
|
The point of a master page is to create reusable content. If you have 130 content pages, the most obvious way to do this, would be to create 130 pages that all use the same master page. The advantage is entirely that you have one place to change the parts of your UI that appear on all pages. Not sure if this is what you were hoping for - master pages are not going to work in the way you seem to be describing ( one aspx which links to a bunch of other pages ). Those other pages are instead going to use the master page.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
That is (in a nutshell) what is happening now functionally, and exactly what I have been attempting to do with Master pages. Which presented me with two different problems.
One, the single content holder that the 130 different pages will all reference, and more importantly, how do I programmatically reassign the various pages/content controls to the contentholder on the master?
And two, I began by creating individual content pages (since they each logically represent a page), but their particular content did not show up on the master. They were properly referenced and created, I started out utterly simple so as not to make mistakes. That is, they did not show up until I abandoned this approach and put the multiple content areas into the application entry page default.aspx. But it does not seem right to have one gargantuan page of content for the 130 different logical pages. I have many pages that contain several thousand lines of code and html each.
I'm sure that I am doing something more fundamentally wrong than programmatically, however it's been impossible to troubleshoot since I have not ran across a single example online or via several Asp.net 2.0 books that have a contentholder on a master page being used by multiple content areas/pages.
Thank you for the quick response.
|
|
|
|
|
nowensone wrote: One, the single content holder that the 130 different pages will all reference, and more importantly, how do I programmatically reassign the various pages/content controls to the contentholder on the master?
Again - that's not how master pages work. Master pages assume you have 130 different pages which all use the same master. If the 130 items were all controls, you could place them all in one page and just change which one was visible.
nowensone wrote: I have not ran across a single example online or via several Asp.net 2.0 books that have a contentholder on a master page being used by multiple content areas/pages.
That's how it always works, all the pages that use a master page, fill the same content areas with different content.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok, the light just went on, I think I see what you are saying (and how my understanding of the concept is backwards/wrong). So my challenge then is really in the navigation controls, which sometimes are the same and sometimes not so depending on the page, but that part I can work out.
Thank you for your help.
|
|
|
|
|
Pleasure
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Dear Programmers,
I need your help. I am developing a project in ASP.NET in which I am using VB.NET as Language. I want to add CheckBox in DataGrid. Even I am succeded in showing the checkbox in Datagrid but I am unable to give the user opportunity to select the checkboxes. The checkbox field directly checks or unchecks the checkbox by getting data from one of the column of my database. My database is in SQL Server 2000.
Please help me. I am also sending the scripting code below.
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<pre>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head2" runat="server">
<title>CheckBoxField Example</title>
</head>
<body>
<form id="form2" runat="server">
<h3>CheckBoxField Example</h3>
<asp:gridview id="AuthorsGridView"
datasourceid="AuthorsSqlDataSource"
autogeneratecolumns="False"
runat="server">
<columns>
<asp:boundfield datafield="au_lname"
headertext="Last Name"/>
<asp:checkboxfield datafield="contract"
text="Contract"
headertext="Contract"/>
</columns>
</asp:gridview>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Pubs sample database. -->
<asp:sqldatasource id="AuthorsSqlDataSource"
selectcommand="SELECT [au_lname], [au_fname], [address], [city], [state], [zip], [contract] FROM [authors]"
connectionstring="server=localhost;database=pubs;integrated security=SSPI"
runat="server">
</asp:sqldatasource>
</form>
</body>
</html>
</pre>
please check the code and tell me where i am doing mistake so that i shall correct it. Please Remember that I am using Visual Studio 2005 as an editor to code ASP.NET.
If you solve the problem then please inform me on the following ID:
zeeshan_st2003@yahoo.com
Thankyou.
Waiting for your reply.
One of your Programmer Friend,
Zeeshan Ahmad.
|
|
|
|
|
Do you need the Checkbox to be dynamically checked or unchecked during databinding ?? Or do you mean you want the checkbox to be fire when user makes a selection in another column in the grid??
For the first, you can attach the value from the datage to the Checked event of the checkbox, so if the value bound is in bit/boolean form from the database, that sets the checked event of the checkbox to false or true.
For the second, you can set it in the such a way that when the user makes a selection in the column that determins the value of the state of the checkbox, based on selection, you either check or uncheck the checkbox in your grid
|
|
|
|
|
Zeeshan Memon wrote: asp:checkboxfield datafield="contract"
text="Contract"
headertext="Contract"
Have you read this?
Because a check box can display only a selected or an unselected state, a CheckBoxField object can be bound only to a field with a Boolean data type or a string that can be parsed by Parse.
So, if "contract" field is boolean type then the checkedbox will display a selected or unselected automatically..
If your field is a string type and the data from that column is not "1" or "0" then ~
- Try to change this column to template column
- Add one more hidden label in that column and set the datafield of this label to the database field (e.g. "contract")
- In Item_bound event, find this label and check/uncheck the checked box accordingly.
e.g. Label l = e.FindControl("myhiddenlabel");
CheckedBox c = e.FindControl("chkBoxContract");
if (l.Text == "abc"){
c.Checked = true;
}
P.S: I wrote this example just like that here without checking in Visual studio.. but you may get some ideas from this code..
Hope it helps..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
i'm tryin to create a quiz management system. but i'm havin a problem automatically gradin. heres a screenshot for wats happening, wich is not wat shud hapen. as u can see its marking correct answers as wrong.
http://www.fiwizone.com/alex/byron/pics/project.jpg
heres the code 4 when u press finish.
Protected Sub finButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles finButton.Click
Dim right As Integer = 0, wrong As Integer = 0
For Each item As DataListItem In DataList1.Items
Dim dv As System.Data.DataView
Dim tfRadioButtonList As RadioButtonList = CType(item.FindControl("tfRadioButtonList"), RadioButtonList)
Dim QuestionIDHiddenField As HiddenField = CType(item.FindControl("QuestionIDHiddenField"), HiddenField)
Dim AnsHiddenField As HiddenField = CType(item.FindControl("AnsHiddenField"), HiddenField)
Dim wrongPanel As Panel = CType(item.FindControl("wrongPanel"), Panel)
Dim correctPanel As Panel = CType(item.FindControl("correctPanel"), Panel)
CType(item.FindControl("fbPanel"), Panel).Enabled = False
CType(item.FindControl("lsPanel"), Panel).Enabled = False
CType(item.FindControl("mcPanel"), Panel).Enabled = False
CType(item.FindControl("tfPanel"), Panel).Enabled = False
Select Case QuestionIDHiddenField.Value.ToString.Substring(0, 2)
Case "FB"
Case "MC"
Case "LS"
Case "TF"
Select Case tfRadioButtonList.SelectedValue.ToString = AnsHiddenField.Value.ToString
Case True
correctPanel.Visible = True
wrongPanel.Visible = False
right += 1
Case False
wrongLabel.Text = "Your Answer: " + tfRadioButtonList.SelectedValue.ToString + " Correct Answer: " + AnsHiddenField.Value.ToString
wrongPanel.Visible = True
correctPanel.Visible = False
wrong += 1
End Select
End Select
Next
summaryLabel.Text = "Right: " & right & ". " & "Wrong: " & wrong
summaryLabel.Visible = True
End Sub
|
|
|
|
|
is there any chance to create button to select(Deselect) all the CheckedBox Columns in my Grid with client-side script?
|
|
|
|
|
Please check-out this link below..
http://www.codeproject.com/aspnet/ChkBoxInGrid.asp[^]
but one thing... The author used a checkedbox (at the top) to select/deselect all checkedboxs in this article.. So, you should probably change this checkedbox to button...
Hope it helps..
|
|
|
|
|
Make it more explainatory what exactly you have and what you want.
Based on what I could understand I can say create a button at runtime and add that string to innerHTML property of form.You can call a function on click event of that button
Button_Click = "javascript:FuncationName();" loop through all the checkboxes and make desired changes.
If you can elaborate requirement properly I can be more specific.
"""" Before hanker after an answer understand the question """""
|
|
|
|
|
Hello Everyone,
I have posted this problem on more than 2 to 3 forums . But sadly no body answered it. Hope, I will get an answer, atleast one reply from this forum.
The problem is regarding encoding of file name to be displayed on the Save / Open dialog , while downloading file.
Here is my download code. ( in ASP.NET 2.0 C# VS2005 )
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=" + fileName + ".pdf");
Response.BinaryWrite(fileData);
Response.End();
Where fileData is binary Array and fileName is name of file. Now for "English" file name , there is no problem of encoding. File Name is displayed properly on File Save / Open dialog , while downloading. But , when file Name is in "Japanese" , some encoding problem arises. File Name is shown in wrong japanese / garbage characters.
I receive this fileName from database, which is in UTF-8 encoding. Even this Japanese fileName is displayed properly on screen, in a listing which shows fileName and their size. For Screen , encoding is set to UTF-8.
To tackel this problem, I tried by setting Response.Charset = "SHIFT-JIS", but still then problem persists.
Pls can u help me? I Don't know how to set encoding in Response.AddHeader( ) while showing fileName.
Please answer this one.
|
|
|
|
|
Honestly, I don't have so much idea about Japanese character... but i wanna give you some suggestions....
What about this code??
Response.ContentType = "application/pdf";<br />
Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName) + ".pdf");<br />
Encoding encoding = Encoding.GetEncoding("Shift-JIS");<br />
Response.BinaryWrite(encoding.GetBytes(fileData));<br />
Response.End()
|
|
|
|