|
|
Great Code....
Keep It Up!!!!;P
|
|
|
|
|
What the hell you want to ask?
Best Regards,
Apurva Kaushal
|
|
|
|
|
this is not Lounge
With Regards
Satips
|
|
|
|
|
What do you mean by that will that be OK in lounge..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hope apart from programming we can discuss everything.so i replied him like that
With Regards
Satips
|
|
|
|
|
i have the page divided into 2 frames using frameset in html.
i need to change the page displayed in the right frame on an clickbutton event raised in the left page. something like <a href target=frame...
how do i do that in codebehind??
thx in advance
=JR=
|
|
|
|
|
Hello
Call following Method in Page_Load in CodeBehind of the left Frame:
Public Sub RefreshFrame(ByVal frame, ByVal loc)
Dim sTemp As String
If Not Me.IsStartupScriptRegistered("RefreshFrame") Then
sTemp = "<script language=JavaScript>" & vbCrLf
sTemp += "if (parent.frames[" & Chr(34) & frame & Chr(34) & "]) {" & vbCrLf
sTemp += "parent.frames[" & Chr(34) & frame & Chr(34) & "].location.href=" & Chr(34) & loc & Chr(34) & ";" & vbCrLf
sTemp += "}" & vbCrLf
sTemp += "</script>" & vbCrLf
Me.RegisterStartupScript("RefreshFrame", sTemp)
End If
End Sub
This Method generates a little bit JavaScript in Code of the left Frame, that reloads the other Frame with a specific URL.
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
I am creating a web setup project.I have to assign permissions to certain folder after the installation in the virtual directory created, i want to know how to acheive this.
please advice
Regards,
Sivaprasad
|
|
|
|
|
There are a couple of ways that you can do:
+ Use the Directory.SetAccessControl method.
+ Use the cacls tool and you can use the Process class to make it work.
+ Use WMI.
|
|
|
|
|
hi there,
can anyone tell me why i get this error and how to fix it :
-------------------------------------------
Line 1: Incorrect syntax near ')'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ')'.
Source Error:
Line 63: MyCommand = New SqlDataAdapter(sqlstr, MyConnection)
Line 64: MyDataset = New DataSet
Line 65: MyCommand.Fill(MyDataset, "Customers")
Line 66: DataGrid1.DataSource = MyDataset.Tables("Customers").DefaultView
Line 67: DataBind()
-------------------------------------------------------------
here is my code :
------------------
<code>
<%@ Page Language="VB" Debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="system.io" %>
<script runat="server">
Dim Conn As String = ConfigurationSettings.AppSettings("Conn")
dim MyConnection as SqlConnection=new SqlConnection(Conn)
dim MyDataset As DataSet
dim MyTable As DataTable
Dim myReader As SqlDataReader
dim MyCommand As SqlDataAdapter
Dim catCMD As SqlCommand = MyConnection.CreateCommand()
dim sqlstr As String
dim ACurrency
dim SQLUser
sub Page_Load(obj as object, e as eventargs)
if session("Admin")="" then response.redirect ("../admin.aspx")
sqlstr = "select ACurrency from SConstants"
MyCommand = New SqlDataAdapter(sqlstr, MyConnection)
MyDataset = New DataSet
MyCommand.Fill(MyDataset)
MyTable = MyDataset.Tables(0)
If MyTable.Rows.Count > 0 then
ACurrency=MyTable.Rows(0).Item("ACurrency")
end if
if not ispostback then
ToGrid()
end if
end sub
sub Change(obj as object, e as eventargs)
dim DeliverStatus
if obj.CommandName=0 then
DeliverStatus=1
else
DeliverStatus=0
end if
sqlstr = "UPDATE Orders SET DeliverStatus = " & DeliverStatus & " Where Order_Number = '" & obj.CommandArgument & "'"
MyCommand = New SqlDataAdapter(sqlstr, MyConnection)
MyDataset = New DataSet
MyCommand.Fill(MyDataset)
ToGrid()
End Sub
function ToGrid()
if request("Userid")<>"" then
SQLUser=" where Orders.Userid=" & request("Userid")
end if
sqlstr="SELECT Order_Number,Orders.UserTempID,Customers.UserID,FirstName,LastName,Orders.PayMethodID,PayMethodName,DeliverStatus,Total,ODate,CardStatus FROM Customers Inner JOIN (PayMethod Inner JOIN (Orders left join CreditCards on Orders.UserTempID=CreditCards.UserTempID) ON PayMethod.PayMethodID = Orders.PayMethodID) ON (Customers.UserID = Orders.UserID)" & SQLUser & " order by Odate Desc"
MyCommand = New SqlDataAdapter(sqlstr, MyConnection)
MyDataset = New DataSet
MyCommand.Fill(MyDataset, "Customers")
DataGrid1.DataSource = MyDataset.Tables("Customers").DefaultView
DataBind()
end function
Sub SortResults(sender as Object, e as DataGridSortCommandEventArgs)
if request("Userid")<>"" then
SQLUser=" where Cart.Userid=" & request("Userid")
end if
sqlstr="SELECT Order_Number,Orders.UserTempID,Customers.UserID,FirstName,LastName,Orders.PayMethodID,PayMethodName,DeliverStatus,Total,ODate,CardStatus FROM Customers Inner JOIN (PayMethod Inner JOIN (Orders left join (CreditCards) on Orders.UserTempID=CreditCards.UserTempID) ON PayMethod.PayMethodID = Orders.PayMethodID) ON (Customers.UserID = Orders.UserID)" & SQLUser & " order by " & e.SortExpression & ""
MyCommand = New SqlDataAdapter(sqlstr, MyConnection)
MyDataset = New DataSet
MyCommand.Fill(MyDataset, "Customers")
DataGrid1.DataSource = MyDataset.Tables("Customers").DefaultView
DataBind()
End Sub
</script>
<html>
<head>
<title>Shopping Cart Administration</title>
</head>
<body>
<center>
<!--#INCLUDE file="adminHeader.aspx"-->
<table cellpadding=0 cellspacing=0 border=0 width=749 class=fontm>
<tr>
<td>
<strong>Orders Report</strong><br><br>
<%if request("update")="1" then%>
Payment status was updated successfully<br><br>
<%end if%>
<form runat="server">
<asp:DataGrid id="DataGrid1" runat="server" BorderColor="#456298" GridLines="Both" cellpadding="4" cellspacing="0" Font-Names="Arial" Font-Size="13px" HeaderStyle-BackColor="#456298" ItemStyle-BackColor="#ffffff" AutoGenerateColumns="false" AllowSorting="true" OnSortCommand="SortResults">
<HeaderStyle forecolor="White" font-bold="True" horizontalalign="Center"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="Order ID" SortExpression="Order_Number">
<ItemTemplate>
<A href="OrderDetails.aspx?id=<%# Container.DataItem("UserTempID")%>"><%# Container.DataItem("Order_Number")%></A>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Name" SortExpression="LastName">
<ItemTemplate>
<A href="CustomerDetails.aspx?id=<%# Container.DataItem("UserID")%>"><%# Container.DataItem("FirstName") & " " & Container.DataItem("LastName")%></A>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Paid by" SortExpression="PayMethodName">
<ItemTemplate>
<%# IIF(Container.DataItem("PayMethodID")=1,"<a href=CardDetails.aspx?id=" & Container.DataItem("UserTempID") & ">","")%><%# Container.DataItem("PayMethodName")%><%# IIF(Container.DataItem("PayMethodID")=1,"</a>","")%>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="CC Status" SortExpression="DeliverStatus">
<ItemTemplate>
<%# IIF(IsDBNull(Container.DataItem("CardStatus")),"<center>-</center>",Container.DataItem("CardStatus")) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Shipment" SortExpression="DeliverStatus">
<ItemTemplate>
<%# IIF(Container.DataItem("DeliverStatus")=0,"Pending","Shipped")%>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Change Status">
<ItemTemplate>
<asp:button id="btChange" onclick="Change" CommandName='<%# Container.DataItem("DeliverStatus") %>' CommandArgument='<%# Container.DataItem("Order_Number") %>' Text='<%# IIF(Container.DataItem("DeliverStatus")=0,"Mark as Shipped","Change to Pending")%>' width=130 runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Total Price" SortExpression="Total">
<ItemTemplate>
<%# ACurrency & Container.DataItem("Total") %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn HeaderText="Date" DataField="ODate" SortExpression="ODate" />
</Columns>
</asp:DataGrid>
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
</code>
|
|
|
|
|
Hi
I guess there is a problem in your query string in ToGrid() function.
You are taking inner join of Customer and Paymethod but specifying join condition as Customers.UserID = Orders.UserID .I guess it should be something like Customers.UserID = Paymethod.UserID.
I hope it'll work fine.
Irshad
|
|
|
|
|
Wow, I guess that you are coming from the world of the classic ASP, but like Irshad said you might want to double check SQL query syntax. You should use the ASP.NET coding model to develop a web page to make your code clearer, it looks like jam currently.
|
|
|
|
|
Hi,
I'm retrieving data from a database and need to display it in labels within a repeater. I do this using:
<code><asp:Label ID="Label1" runat="server" CssClass=".bold" Text='<%# DataBinder.Eval(Container.DataItem, "staff_Firstname") %>'></asp:Label></code>
However in some situations i need to display 2 or 3 fields of data in one label eg Firstname and Lastname. I tried the following:
<code><asp:Label ID="Label1" runat="server" CssClass=".bold" Text='<%# DataBinder.Eval(Container.DataItem, "staff_Firstname") %> <%# DataBinder.Eval(Container.DataItem, "staff_Lastname") %>'></asp:Label></code>
However this returns errors. I know this is possible to achieve as ive done it in the past but cannot remember how as its been a long time since i last used .Net.
Any help would be appreciated.
Thanks!
|
|
|
|
|
Yes you can do that check the following code.
<ASP:Label ID="lblBindAllData" Text='<%#DataBinder.Eval(Container.DataItem, "FirstName").ToString()+","+DataBinder.Eval(Container.DataItem, "LastName").ToString()+","+DataBinder.Eval(Container.DataItem, "Address1").ToString()+","+DataBinder.Eval(Container.DataItem, "Address2").ToString()+" "+DataBinder.Eval(Container.DataItem, "ZipCode").ToString() %>' Visible=true runat="server" />
Hope this will solve your problem.
"Walking on water and developing Software on a specification is easy, if
both are frozen..."
|
|
|
|
|
|
What Is Hash Tables In ASP.NET??? plz help
Regards:
Geetika Munjal
|
|
|
|
|
|
In few words a Hash table is a vector where the index is not necessary to be a number, could be a string
hashTable["bob"]
hashTable["peter"]
keep Learning and you never will be out of date...
|
|
|
|
|
Hi friends,
Am having a WebForm in which the user enters all his details and it gets stored in the database.
I want the phone numbers to be stored only as numbers excluding any special characters like '(',')','-' etc...
Is there any generic method eliminate all special characters that an user enters in the textbox?
Or any alternate method?
Also please tell me how to use the "Data Formatting Expression" in datagrid to display the data in required format.
Please help me....
-- modified at 5:47 Wednesday 20th September, 2006
|
|
|
|
|
Vsree wrote: Is there any generic method eliminate all special characters that an user enters in the textbox?
See the RegularExpressionValidator in MSDN, also you can find some sample expressions that can be used with the validator from the link[^].
Vsree wrote: Also please tell me how to use the "Data Formatting Expression" in datagrid to display the data in required format.
Numeric Format [^]
|
|
|
|
|
hi everybody
today i come here with a new doubt;
in one registration form, i have used a html filefield control to browse an photograph of the user and i have converted this image into binary and stored inthe database. but after that i need to retrieve that binary data and dispaly that in an imagecontrol in the next form. anybody know any method to assign this binary data to the image control.
please share some ideas. thanks in advance.
sebastian
|
|
|
|
|
You can create another apx page and in the page load of this new aspx you can write this.
byte[] image = null;
image =(byte[])objDV[0]["imgImage1"];// Taking it from dataview/dataset/dtable
Response.ContentType = objDV[0]["strImage1ContentType"].ToString();
Response.BinaryWrite(image);
Assume this new aspx page name is ImageLoad.aspx
In your page where you are taking an Image control, call the method from aspx
page.
<asp:image id="imgLogo" runat="server" imageurl="<%#GetLogoURL(DataBinder.Eval(Container.DataItem,"intId"))%>" alternatetext="Dynamic Image">
and in code behind you will have
protected string GetLogoURL(object objLogo)
{
return "ImgLoad.aspx"
}
Let me know if this worked for you.
"Walking on water and developing Software on a specification is easy, if
both are frozen..."
|
|
|
|
|
|