|
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()
|
|
|
|
|
Hi,this is my code.how to use OR condition in c# code,this code is not working.i want to check the selected image extension.if the extension .jpg or .bmp then it is going to this condition code.what is wrong in that.
if (System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".jpg" | System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".bmp")
|
|
|
|
|
Try || ..
e.g.
if (System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".jpg" || System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".bmp")
|
|
|
|
|
Either || or | will work (although the non-short-circuiting single pipe is an odd choice here since it's more commonly used for bitwise or).
Are you sure you don't want to test for equality rather than inequality?
string lower = System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower();
if (lower == ".jpg" || lower == ".bmp")
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to C++/CLI Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
I think u have to put 2 piping(||)characters in ur code
It's like this..
if ((System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".jpg") ||(System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".bmp"))
try this once...
|
|
|
|
|
i made my web setup file
and worked well.
and now the database how can i Attach it -or restore it-what if the user doesnt have SQL i added sql express edition as prerequsities.
|
|
|
|
|
I have to mail a file as attachment which is on other server
How to access that file
Gaurav
|
|
|
|
|
try using the UNC path as such: \\Servername\foldername\filename.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
Hi,
I have an aspx app which needs to post data to a form and read the response.
i try to use "webClient" and "HttpWebRequest" classes, but can not get response ?
can you help me and get a refrence?
please
|
|
|
|
|
function xmlhttpPost(strURL) {<br />
var xmlHttpReq = false;<br />
var self = this;<br />
if (window.XMLHttpRequest) {<br />
self.xmlHttpReq = new XMLHttpRequest();<br />
}<br />
else if (window.ActiveXObject) {<br />
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");<br />
}<br />
self.xmlHttpReq.open('POST', strURL, true);<br />
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');<br />
self.xmlHttpReq.onreadystatechange = function() {<br />
if (self.xmlHttpReq.readyState == 4) {<br />
updatepage(self.xmlHttpReq.responseText);<br />
}<br />
}<br />
self.xmlHttpReq.send(getquerystring());<br />
}<br />
<br />
function getquerystring() {<br />
var form = document.forms['f1'];<br />
var word = form.word.value;<br />
qstr = 'w=' + escape(word);
return qstr;<br />
}
------------------------------------------------------
This is for posting....
self.xmlHttpReq.send(getquerystring());
This is for getting the response....
self.xmlHttpReq.responseText
|
|
|
|
|
hi : Michael Sync
tank you .
your answer is with javaScript.
can you get me an example with C# or VB.NET ?
|
|
|
|
|
Have you read Bassam Saoud's post?? maybe.. this is what you want..
|
|
|
|
|
you want to post data from an ASP.NET application to a form in another ASP.NET application ?
Anyways to post data from a web form to another you can Add PostBackUrl="<YOUR_FORM_Path>" property to the submit button or use Server.Transfer and set the preserveForm parameter to True (for example Server.Transfer("<YOUR_FORM_Path>", True) )
Now to read post data you can use Request.Forms("<your_controlid>") to access value for a specific control
Hope this helps.
|
|
|
|
|