|
Why Do you use style in html tag?
sepel
|
|
|
|
|
I've already hosted some web sites developed in .NET Frame 1.1 and wud like to do the upcoming projects in .NET Frame 2.0 is it feasible to this shifting and hosting it in the webserver ?
|
|
|
|
|
You can't host both on the same webserver, no.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If you want to run 1.1 websites and 2.0 website this is possible on the same server, I think you just have to change
the Configuration file.
2.0 supports 1.1 (so microsoft said), but i had a few issues when I switched.
BTW only switch to 2.0 if your actually going to use any of the 2.0 framwork.
|
|
|
|
|
You can run .NET 1.1 and .NET 2.0 applications on the same web server. One thing that's important is to section them off into different application pools-
http://technet.microsoft.com/en-us/library/cc757073.aspx[^]
Ranjit Viswakumar
Professional Services Specialist
http://hostmysite.com/?utm_source=bb
|
|
|
|
|
Hello everyone, I am having a bit of a problem with my asp.net code (vb). I am attempting to update a datagrid on my page. This is something I have already completed in a previous page. The only difference here that I can tell is that I have made the datagrid on this problem page an updatable datagrid without putting each row into edit mode (using textboxes instead of labels).
When I attempt to assign the values of my datagrid into my vb code I am getting that dreaded "Object reference not set to an instance of an object."
The assignment sits inside a for each. Yet if I pull it out and put it outside the for each (just to see if it will fail again) I receive the same error message. I am stumped. I can't figure out why it works on one asp page, but not this one.
Here is my code. Hopefully someone will be able to help me. P.S. This is for an school project and I am quite new to ASP (about 2 wks new )
Thank you in advance.
<br />
<div style="text-align: center; background-color: lightgrey;"><br />
<br /><br />
<br />
<asp:checkboxlist id="chkFocusSearch" runat="server" autopostback="false" repeatdirection="Horizontal" xmlns:asp="#unknown"><br />
DataValueField="tid" DataTextField="Type_" Width="360px" > <br />
</asp:checkboxlist><br />
<br />
<asp:button id="btnSlctAll" runat="server" onclick="btnSlctAll_Click" text="Selet All" xmlns:asp="#unknown"><br />
Width="114px" /> <br />
<br />
<asp:button id="btnSlctNone" runat="server" text="Select None"><br />
Width="114px" OnClick="btnSlctNone_Click" /> <br />
<br />
<asp:button id="btnRefresh" runat="server" text="Refresh View" onclick="RefreshInv" /> <br />
<br />
<asp:datagrid id="mysqlInvGrid" runat="server" cellpadding="4" forecolor="#333333" showfooter="True" bordercolor="Black"><br />
OnItemCommand="Update"<br />
AutoGenerateColumns ="False" BorderWidth="8px" CellSpacing="3" style="border-right: black thin solid; border-top: black thin solid; border-left: black thin solid; border-bottom: black thin solid" Height="299px" Width="360px"><br />
<br />
<columns><br />
<asp:boundcolumn datafield="prodid" visible="false" /><br />
<asp:boundcolumn datafield="item" headertext="Item" /><br />
<br />
<asp:templatecolumn visible="False"><br />
<itemtemplate><br />
<asp:label id="aspProdID" runat="server" text="<%# DataBinder.Eval(Container.DataItem, "prodid") %>" /><br />
</itemtemplate> <br />
</asp:templatecolumn><br />
<br />
<br />
<asp:templatecolumn headertext="Quantity"><br />
<br />
<footertemplate><br />
<asp:button id="btnUpdate" runat="server" text="Update" /><br />
</footertemplate><br />
<br />
<itemtemplate><br />
<asp:textbox id="aspAmount" runat="server" columns="5" text="<%# Container.DataItem("amount") %>" /><br />
</itemtemplate><br />
</asp:templatecolumn><br />
<br />
<asp:boundcolumn datafield="measure" headertext="Measurement" /><br />
<br />
<br />
</columns><br />
</asp:datagrid></asp:button></asp:button></div>
<br />
Sub Update(ByVal Sender As Object, ByVal e As DataGridCommandEventArgs)<br />
Dim dgI As DataGridItem<br />
Dim strSql As String<br />
Dim sqlCmd As New MySqlCommand<br />
<br />
sqlCmd = New MySqlCommand()<br />
mysqlConn = DBConnect.Connect<br />
sqlCmd.Connection = mysqlConn<br />
<br />
Try<br />
<br />
For Each dgI In mysqlInvGrid.Items<br />
'get the Prod ID and the new quantity<br />
Dim strProdID As String = CType(e.Item.FindControl("aspProdID"), Label).Text<br />
Dim strQuantity As String = CType(e.Item.FindControl("aspAmount"), TextBox).Text<br />
<br />
Dim intProdID As Integer = CInt(strProdID)<br />
Dim intQuantity As Integer = CInt(strQuantity)<br />
<br />
'Update the DB with the information we have gathered.<br />
<br />
strSql = "update Inventory set quantity = " & intQuantity & " where prodID = " & intProdID<br />
<br />
sqlCmd = New MySqlCommand(strSql, mysqlConn)<br />
sqlCmd.ExecuteNonQuery()<br />
<br />
Next<br />
Catch ex As MySqlException<br />
MsgBox("Insert failed", MsgBoxStyle.Exclamation, "Insert Status")<br />
MsgBox("Error returned was '" & ex.Message, MsgBoxStyle.Information, "Error Message")<br />
MsgBox("SQL command was: '" & strSql)<br />
<br />
<br />
Catch ex As Exception<br />
<br />
MsgBox("Insert failed", MsgBoxStyle.Exclamation, "Insert Status")<br />
MsgBox("Error returned was '" & ex.Message, MsgBoxStyle.Information, "Error Message")<br />
<br />
Finally<br />
<br />
mysqlConn.Close()<br />
BindGrid()<br />
<br />
End Try<br />
<br />
|
|
|
|
|
AAARRRGGHHH!!!
Been working on this for an hour and I spend 5 minutes to type up this post. Take another look at it and figure out the problem.
When I into the For each of my datagrid I made the mistake of passing in 'e' which was the datagridcommandeventargs handler and not the actual datagrid item.
the correct code is:
<br />
Sub Update(ByVal Sender As Object, ByVal e As DataGridCommandEventArgs)<br />
Dim dgI As DataGridItem<br />
Dim strSql As String<br />
Dim sqlCmd As New MySqlCommand<br />
<br />
sqlCmd = New MySqlCommand()<br />
mysqlConn = DBConnect.Connect<br />
sqlCmd.Connection = mysqlConn<br />
<br />
Try<br />
<br />
For Each dgI In mysqlInvGrid.Items<br />
'get the Prod ID and the new quantity<br />
Dim strProdID As String = CType(dgI.FindControl("aspProdID"), Label).Text<br />
Dim strQuantity As String = CType(dgI.FindControl("aspAmount"), TextBox).Text<br />
<br />
Dim intProdID As Integer = CInt(strProdID)<br />
Dim intQuantity As Integer = CInt(strQuantity)<br />
<br />
'Update the DB with the information we have gathered.<br />
<br />
strSql = "update Inventory set quantity = " & intQuantity & " where prodID = " & intProdID<br />
<br />
sqlCmd = New MySqlCommand(strSql, mysqlConn)<br />
sqlCmd.ExecuteNonQuery()<br />
<br />
Next<br />
Have a good night all.
|
|
|
|
|
Hi There,
I had written funtion in js file to check two textbox values.Funtion is if textbox1 value is less than textbox 2 value then it should throw an error. I am Calling this funtion on click of save button.There is no problem in executing this funtion.But my problem is that when I Click on Save button this funtion gets executed but after the error occure then also code written on button for save button get executed.Now I want to restrict this code from executing after error occure in js funtion.Is it possible.
If anybody knows please help.
Thanks
|
|
|
|
|
You may want to post some of your code here to help explain your problem and allow for someone to help you out more easily.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Try something like this for your Javascript-
function validateValues(theForm) {
var error = "";
if (theForm.textbox1 < theForm.textbox2) {
reason = "-textbox1 must be greater than textbox2."
}
if (reason != "") {
alert("Some fields need correction:\n" + reason);
return false;
}
return true;
}
...and the form should contain-
<form method=POST action=action.aspx name=Demo onSubmit='return validateValues(this)'>
Good luck!
Ranjit Viswakumar
Professional Services Specialist
http://hostmysite.com/?utm_source=bb
|
|
|
|
|
Hai All
I am using asp.net vs2005 and crystal report 10.2 version , my problem is
that when i access the report repeatedly i am getting "Load report failed".
For this problem i restart my system and it works fine . Is there any
other way to solve this problem without restarting the system.Plz help me.
|
|
|
|
|
hi,
ReportDocument rd=new ReportDocument();
rd.Load("Cryatalreport");
///write rd.Close();//put this line too
hope this will help U
|
|
|
|
|
Hai
Thank You for the reply. After changing the code as you told still i am getting Load report failed . Is any other way to solve it.
Thank you
|
|
|
|
|
i hope my question is clear to all those who are too good in web designing.
I have a sign up page signup.aspx. which redirects to list.aspx. in list .aspx i select a particulasr customer and that customer id is passed to customer.aspx with the help of query string variables. when a logged in shopkeeper goes to customer.aspx, then on that customer .aspx there is a menu on the left which is menu.ascx. this menu has links to different sections of the customer and which ever link is cliked it should navigate to that link. now but to navigate to the section of the corresponding customer i need to pass in the customer id from that menu.ascx to abc.aspx or def.aspx. how do i do that. how will the menu.ascx recognize the customer id from customer.aspx. i dont want to use session variables because if a shopkeeper opens two customers at the same time then it will be a problem. following flow is more clear.
shopekeeper A logs in to system through signup.aspx
|
then a page with many customers is seen known as list.aspx
|
`the shopkeeper clicks any one of the customer and then goes to the main page of that custmer known as customer.aspx
on this customer.aspx there is a menu on left which is menu.ascx a user control which has navigation links to different sections of the selected customer.
|
if section 1 is selected then navigates to abc.aspx
if section 2 then def.aspx
section 3 then ghi.aspx
and so on
but i need the customer id in abc.aspx or def.aspx or ghi.aspc and i need to pass that from menu.ascx . then menu should get the customer id from customer.aspx.
now i want to do the above without using customer id as session varibales.
please advice
|
|
|
|
|
be_humble wrote: how will the menu.ascx recognize the customer id from customer.aspx
You said it's on the query string, so read it off there.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
well, the previous reply starts ya off . . . a cliff.
So, here's the paraglide kite so you can fly rather than fall.
This solution presented assumes these things:
0) you are after an 'easy' solution; no bells/whistles
1) The shopkeeper has multiple customers open at the same time (e.g. different tabs in IE7 / FireFox and/or different windows are opened when the shopkeeper clicks a customer's line
2) The customerID (custID) is passed as a query string on the customer.aspx page.
3) web user controls on the customer.aspx page need to know which customer is being viewed
- e.g. so the web user control, like Menu.ascx, can do a call to a database with the custID to figure out which menus to display or which prefs to display
==== Here's the solution:
1) On the customer.aspx Load method, get the custID from the query string and store it in a hidden field on customer.aspx
2) Create a method on each web user-control (ascx) that you call when the customer.aspx page loads, and pass in the custID to that web user control
- I have used some solutions which have a hidden field on each web user control to 'store' the custID; thus avoiding session variables or repeated calls on page.IsPostBack to 'reset' the custID on each web user control.
If this doesn't help, then hire a consultant.
ASPX ~ Apple Simply Performs eXcellently
|
|
|
|
|
How can we freeze gridview header without using css or javascript?
modified on Saturday, February 7, 2009 12:11 AM
|
|
|
|
|
You could try prayer.
Why would you ask how to do something, when you obviously already know what the tools are for doing it, but don't want to use them ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thank you very much
I ll try it.
But here the problem is ,i ve to change culture.
ie from english to arabic.
Then css or javascript wont work properly.
Thats why asked for any other method.
I ll pray and if i am lucky i ll post answer in this site
|
|
|
|
|
SreejithKumar M wrote: Then css or javascript wont work properly.
Why not ? What makes you think that ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I tried this in css
position:relative;
top:expression(this.offsetParent.scrollTop-5);
it is working in english
but not in arabic language
in arabic allignment direction is right to left
here gridview header is scrolling
|
|
|
|
|
Hi,
I got answer for this solution
I changed
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
in design page
Then i used follwing css
/* Div container to wrap the datagrid */
div#div-datagrid {
width: 420px;
height: 200px;
overflow: auto;
scrollbar-base-color:#ffeaff;
}
/* Locks the left column */
td.locked, th.locked {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
left: expression(document.getElementById("div-datagrid").scrollLeft-2); /*IE5+ only*/
}
/* Locks table header */
th {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
top: expression(document.getElementById("div-datagrid").scrollTop-2); /*IE5+ only*/
z-index: 10;
}
/* Keeps the header as the top most item. Important for top left item*/
th.locked {z-index: 99;}
/* DataGrid Item and AlternatingItem Style*/
.GridRow {font-size: 10pt; color: black; font-family: Arial; background-color:#ffffff; height:35px;}
.GridAltRow {font-size: 10pt; color: black; font-family: Arial; background-color:#eeeeee; height:35px;}
my aspx page is
<div id="div-datagrid">
<asp:GridView ID="gv5" Width="100%" runat="server" BorderStyle="Solid"
BorderColor="Navy" meta:resourcekey="gv5Resource1" UseAccessibleHeader="True">
<HeaderStyle BorderColor="Black" ForeColor="Black" BackColor="LightSkyBlue"
/>
<AlternatingRowStyle BackColor="Transparent" />
</asp:GridView>
</div>
like this
|
|
|
|
|
in aspx page add itemtemplet
|
|
|
|
|
I am tring to view an image from the SQL server, this is the error msg I get. Please help
this is my code:
string strSQL = "SELECT * FROM tblViewImage WHERE (ImageNumner= 1093414)";
SqlCommand cmd = new SqlCommand(strSQL, conn);
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
{
Response.ContentType = dr["ImageType"].ToString();
Response.BinaryWrite((byte[])dr["ViewImage"]);
}
|
|
|
|
|
Have you checked to see what the ImageType is ? You really have a column called ImageNumner ? Why are you hard coding the number ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|