|
Have you already modified the web.config file required by IIS7. Does the web.config file show any errors when it is opened with VS. I suspect it can be as simple as tag not being closed.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
The file is valid XML, it works with the VS2005 web server, and IIS in XP.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Does it have system.webserver section? Which you are prompted to add when running the app under IIS7 for the first time.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
No - I'll google that. Thanks.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I have written the code to export the gridview values to Excel, the main problem i am facing is that i have a column in which there is picture which is not shown in Excel.
It showz the general icon of picture not found.
Please Help.
Thanks and Regards,
Deepak Surana
|
|
|
|
|
im having a problem writing values back to the database. im using sql 2000. the values are pulled in from a datagrid the user can make multiple edits and get click a button that preforms a batch update.
below is the code for the button
Protected
Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim txtPrelimDecisionCode, txtPrelimLetterIssued, txtFinalDecisionCode, txtFinalLetterIssued As TextBox
Dim studentId, classId As Label
Dim gvRow As GridViewRow
Dim sqlConn As New SqlConnection
Dim sqlComm As New SqlCommand
Dim sqlDr As SqlDataReader
sqlConn.ConnectionString = (
"data source=.; integrated security= true; initial catalog=dbStudentRecords;")
Try
sqlConn.Open()
sqlComm.Connection = sqlConn
sqlComm.CommandText =
"SELECT * FROM tblStudentDecision"
sqlDr = sqlComm.ExecuteReader
For Each gvRow In Me.dgResults.Rows
' obtain the values from the dataGrid
studentId =
CType(gvRow.Cells(0).FindControl("studentId"), Label)
classId =
CType(gvRow.Cells(1).FindControl("classId"), Label)
txtPrelimDecisionCode =
CType(gvRow.Cells(21).FindControl("txtprelimDecisionCode"), TextBox)
txtPrelimLetterIssued =
CType(gvRow.Cells(21).FindControl("txtPrelimLetterIssued"), TextBox)
txtFinalDecisionCode =
CType(gvRow.Cells(21).FindControl("txtFinalDecisionCode"), TextBox)
txtFinalLetterIssued =
CType(gvRow.Cells(21).FindControl("txtFinalLetterIssued"), TextBox)
'convert the dataGrid Values into the correct data types(not sure if i need this)
'Dim classIdValue As Integer = Convert.ToInt32(classId)
'Dim prelimDecisionCodeValue As Integer = Convert.ToInt32(txtPrelimDecisionCode)
'Dim prelimLetterIssuedValue As Boolean = Convert.ToBoolean(txtPrelimLetterIssued)
'Dim finalDecisionCodeValue As Integer = Convert.ToInt32(txtFinalDecisionCode)
'Dim finalLetterIssuedValue As Boolean = Convert.ToBoolean(txtFinalLetterIssued)
'values from dataGrid
'these values below are printing to the debug just fine
Debug.Print(studentId.Text)
Debug.Print(classId.Text)
Debug.Print(txtPrelimDecisionCode.Text)
Debug.Print(txtPrelimLetterIssued.Text)
Debug.Print(txtFinalDecisionCode.Text)
Debug.Print(txtFinalLetterIssued.Text)
sqlDr.Read()
If IsDBNull("StudentId") Then
'studentId = CType(gvRow.Cells(0).FindControl("studentId"), Label)
' if record does not exsist insert all fields- not sure of the syntax
'sqlComm.CommandText = "INSERT NEW RECORD"
'sqlComm.ExecuteNonQuery()
Else
' i want to update txtPrelimDecisionCode txtPrelimLetterIssued txtFinalDecisionCode txtFinalLetterIssued if the record already exsists
' i tried to get it working with the first value txtPrelimDecisionCode and then i was going to proceed with the rest but damm it dosent work!!
sqlComm.CommandText =
"UPDATE tblStudentDecision SET prelimDecisionCode='" & txtPrelimDecisionCode.Text & "' WHERE studentId='" & studentId.Text & "'"
sqlComm.ExecuteNonQuery()
End If
Next
Catch ex As SqlException
Trace.Warn(
"dbError: " & ex.Message)
Catch ex As Exception
Trace.Warn(
"Other error: " & ex.Message)
Finally
sqlConn.Close()
End Try
End Sub
i thought this would be straight forward but i seem to be having problems any help would be great!
steve
|
|
|
|
|
Are you using PostBack check? Otherwise the data would rebind and your event handler would be voided of its intended action.
|
|
|
|
|
I don't understand your code. You are not doing this right.
Mistake #1
Attempting to READ from the database when the user clicks submit???
Just store the primary key field(s) in the datagrid to use as a reference.
Mistake #2
You should be using SqlParameters to protect against sql injection
Mistake #3
Your connection string should be in only one place like a session or application object.
Mistake #4
Not using stored procedure to do updates. If you are using integrated security and grant datawriter access to your application, your user could use MS Access or queary analyzer and update the data without your knowledge.
Check out MSDN or a basic programming book for more information.
MSDN
|
|
|
|
|
in ASP.net i have created one project in that i want to find the Row number iam using datagrid how to do it?
|
|
|
|
|
Any row number? Mate, be more specific!!!
myDataGrid.SelectedIndex ??
Pilo
|
|
|
|
|
|
In my project if i click one button then all of the Check boxes must be checked how to do it?
|
|
|
|
|
For simple question, simple answer: assign event handler to your button and in this event handler go through all your checkboxes and set their property Checked to true.
Pilo
|
|
|
|
|
If it is a clientside JavaScript, then you can loop through the checkbox contents and if it contains a pattern, you can check it. The pattern is required because serverside checkboxes would have their IDs/NAMEs scrambled.
|
|
|
|
|
hi
u refer this code
function SelectAllCheckboxes(spanChk){
// Added as ASPX uses SPAN for checkbox
var oItem = spanChk.children;
var theBox=(spanChk.type=="checkbox")?spanChk:spanChk.children.item[0];
xState=theBox.checked;
elm=theBox.form.elements;
for(i=0;iif(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
{
//elm[i].click();
if(elm[i].checked!=xState)
//elm[i].click();
elm[i].checked=xState;
}
}
function DeSelectCheckBoxes(spanChk)
{
// Added as ASPX uses SPAN for checkbox
var oItem = spanChk.children;
var theBox=(spanChk.type=="checkbox")?spanChk:spanChk.children.item[0];
xState=theBox.checked;
// this means it is deselected
if(xState == false)
{
elm=theBox.form.elements;
for(i=0;i if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
{
elm[i].checked=false ;
}
}
}
function HighlightRow(chkB) {
var oItem = chkB.children;
xState=oItem.item(0).checked;
if(xState)
{chkB.parentElement.parentElement.style.backgroundColor='lightcoral'; // grdEmployees.SelectedItemStyle.BackColor
chkB.parentElement.parentElement.style.color='white'; // grdEmployees.SelectedItemStyle.ForeColor
}else
{chkB.parentElement.parentElement.style.backgroundColor='white'; //grdEmployees.ItemStyle.BackColor
chkB.parentElement.parentElement.style.color='black'; //grdEmployees.ItemStyle.ForeColor
}
}
regards
saravanan
|
|
|
|
|
There's a much easier way if you want to use client-side code:
string script="<script>function CheckAll(){";<br />
script += "document.getElementById('" + CheckBox1.ClientID + "').checked = true";<br />
script += "document.getElementById('" + CheckBox2.ClientID + "').checked = true";<br />
...<br />
script += "}</script>";<br />
<br />
Page.RegisterStarupScript("CheckAll", script);<br />
Button1.Attributes.Add("onclick", "Checkall();return false");<br />
Obviously this code has some bad things about it (if you have 100 CheckBoxes, it gets very lengthy, and also much slower, then if you would use StringBuilder). Also for ASP.NET 2.0 use should use
Page.ClientScript.RegisterStarupScript(this, "CheckAll", script);
I just wanted to show that you can do this without writing tons of nasty Javascript, and still get it working on the client-side, and also the you DO know the client-side ID of server controls (ClientID property).
|
|
|
|
|
hi all,
here i am facing one problem.. In my Select Query i'm using NVL(field,'') and binding to grid . in my grid item command i am displaying these details with cell values. the null filed are displaying '&'nbsp; (no quotes for ampersand, for display i had written so) , i had tried check with trim, giving '&'nbsp; (no quotes for ampersand, for display i had written so)while passing to text box, but in vain..
pls. tell me what i have to do..
thanks..
-- modified at 11:29 Wednesday 6th December, 2006
|
|
|
|
|
i want to simulate a menu with two div elemen.
one for father node which its position is no absolute and placed in an table cell.
another div is my menu body. i should find the position of first div (top, left) and then set the position of second div. i check style.top, style.left, all["div1"].style.top, all["div2"].style.left,...
but i don't have any resault. how can i find the first div position in the browser window?
thanks
rastgar
|
|
|
|
|
hai,
I need information of this,
I am displaying an image using ImageButton(an warehouse image), i am searching for some product in warehouse on sucessful search red sports are drawn on image which tells products at particular location.
problem is i want to display product attributes on "Mouse Hover" over the image, i want to know how can i get control of mouse hover event in code behind along with its x,y cordinates, so that i can display mouse hover text message. I know the tool tip but its is not dynamic.
can any one give me solution for this...
krish...
|
|
|
|
|
You can't get the mouse position in the code behind (you can't get any real time data from the client in code behind) because its server-side. You will have to use javascript to track the mouse and do the necessary actions.
|
|
|
|
|
hi ,
i want to ask if there is any possible security risk in uploading different file extension to web server ??
|
|
|
|
|
You can safely upload to a folder where the folder does not have EXECUTE or SCRIPT permission. Additionally it ought to be outside the Virtual Directories for higher and elevated levels of protection.
Furthermore, if you can afford, you can have a virus scan enabled.
|
|
|
|
|
potentionaly...
it depends on what are you doing with uploaded files.
if you store them somewhere within your application domain, be sure to set iis to deny access to folder where you store these files, as anybody can upload for example aspx page with malicious code and then simply access it and execute this code...
maybe you could write little bit more about purpose of uploading files in your application, so somebody can give you more appropriate answer
Pilo
|
|
|
|
|
plz if anyone has an idea or any articles,tutorials that have the idea bout how to make a site builder (site that create a dynamic sites)
plz help me
thanx
rony
|
|
|
|
|
You can start at the top here: How to get an answer to your question
3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
only two letters away from being an asset
|
|
|
|