|
Are you asking us or you are telling us ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
send file to browser
response.redirect("~/doc/filename.xls");
keyur satyadev
|
|
|
|
|
Report1
when i click the above link button the excel document report1 is opened...
it located in my project itself...
now my need is if i click the link button...
i have to open a excel doc located in my D:
how can do this
help me...
|
|
|
|
|
Why are creating a new post as replying for a post?
Apurva Kaushal
|
|
|
|
|
wats its code i also want to do it on link button click
|
|
|
|
|
I have the following on the click event of a button in the footer of a DataGrid:
If e.CommandName = "Assign" Then
If e.Item.ItemType = ListItemType.Footer Then
Dim control_name As New DropDownList
control_name = e.Item.FindControl("control_name")
Dim row As DataRow = dt.NewRow
row(0) = Session("ID")
row(1) = control_name.SelectedItem.Value
row(2) = control_name.SelectedItem.Text
dt.Rows.Add(row)
datagrid.DataSource = dt
datagrid.DataBind()
End If
End If
The only difficulty i'm having is adding multiple rows to the datatable it adds one fine but for 2 it won't.
please if anyone can see the errors of my ways please inform me its much appreciated
|
|
|
|
|
Is this section of code is getting executed when you are clicking the button for the second or the third time?
Apurva Kaushal
|
|
|
|
|
Yes it's executed everytime i click this button
|
|
|
|
|
Add a code line in bold in your code.
If e.CommandName = "Assign" Then
If e.Item.ItemType = ListItemType.Footer Then
Dim control_name As New DropDownList
control_name = e.Item.FindControl("control_name")
Dim row As DataRow = dt.NewRow
row(0) = Session("ID")
row(1) = control_name.SelectedItem.Value
row(2) = control_name.SelectedItem.Text
dt.Rows.Add(row)
dt.AcceptChanges();
datagrid.DataSource = dt
datagrid.DataBind()
End If
End If
It will work fine.
Regards,
Kaushal Arora
|
|
|
|
|
I AM USING FILE UPLOAD CONTROL TO SAVE THE FILE.AND FILE STORED IN THE FOLDER. NOW I WANT THAT IHAVE LINK BUTTON FOR FILE NAME ON CLICKING ON LINK BUTTON FILE OPENED. I HAVE A WORD FILE . PLS HELP.
|
|
|
|
|
An All-Caps in a discussion board may send a signal to other users that you are in an angry mood and shouting at them, thus discouraging them from lending you a helping hand.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Consider this article on codeproject.com-
http://www.codeproject.com/KB/aspnet/fileupload.aspx[^]
It covers the following 6 areas-
* How to set up a form for file uploading
* How to receive uploaded files on the server side
* How to save uploaded files to hard drive
* How to save uploaded files in a database
* How to retrieve a file that is stored in a database and return it to a client
* Security considerations running the demo project
Try that out. Good luck!
Ranjit Viswakumar
Professional Services Specialist
http://hostmysite.com/?utm_source=bb
|
|
|
|
|
Hi everyone
I have searched the whole day long now and cant seen to find, maybe searching in the wrong places
If someone could please help me
I have a aspx vb project using crystal reports, now what I want to do is ,
when the user hits the print button the report should print to a printer shared on a computer connected to the network.
Now this is working when I run the app in visual studio but when its published to the iis it gives me a "access denied" error when i set the printer as \\pcIP\printername , or when i view the printer queue it says, "error - printing" when i set the printer as a normal printer on the server giving it a new port looking at the same place as before
this is how i do it
create a report doc -> rpt
rpt.PrintOptions.PrinterName = "\\IP\printer"
rpt.PrintToPrinter(1, False, 0, 0)
any help would be great
|
|
|
|
|
Ok so no reply from anyone, so I'll leave what I got
When using network resources the asp.net "user" doesn’t have the required rights.
So , what you need to do is impersonate a user on the sever having the rights the access the network .
Create a class, call it whatever you want, I’ll call this one impersonation and add the following:
Some of the imports won’t be needed
Imports Microsoft.VisualBasic
Imports System.Web.Security
Imports System.Security.Principal
Imports System.Runtime.InteropServices
Imports System.Threading
Imports System.Configuration
Imports SR = System.Reflection
Imports System.Text
Imports System.Web.UI.WebControls
Public Class Impersonation
Private Const LOGON32_PROVIDER_DEFAULT As Integer = 0
Private Const LOGON32_LOGON_INTERACTIVE As Integer = 2
Private Const LOGON32_LOGON_NETWORK As Integer = 3
Private Const LOGON32_LOGON_BATCH As Integer = 4
Private Const LOGON32_LOGON_SERVICE As Integer = 5
Private Const LOGON32_LOGON_UNLOCK As Integer = 7
Private Const LOGON32_LOGON_NETWORK_CLEARTEXT As Integer = 8
Private Const LOGON32_LOGON_NEW_CREDENTIALS As Integer = 9
Private Shared ImpersonationContext As WindowsImpersonationContext
Declare Function LogonUserA Lib "advapi32.dll" ( _
ByVal lpszUsername As String, _
ByVal lpszDomain As String, _
ByVal lpszPassword As String, _
ByVal dwLogonType As Integer, _
ByVal dwLogonProvider As Integer, _
ByRef phToken As IntPtr) As Integer
Declare Auto Function DuplicateToken Lib "advapi32.dll" ( _
ByVal ExistingTokenHandle As IntPtr, _
ByVal ImpersonationLevel As Integer, _
ByRef DuplicateTokenHandle As IntPtr) As Integer
Declare Auto Function RevertToSelf Lib "advapi32.dll" () As Long
Declare Auto Function CloseHandle Lib "kernel32.dll" (ByVal handle As IntPtr) As Long
Public Shared Function ImpersonateValidUser(ByVal strUserName As String, _
ByVal strDomain As String, ByVal strPassword As String) As Boolean
Dim token As IntPtr = IntPtr.Zero
Dim tokenDuplicate As IntPtr = IntPtr.Zero
Dim tempWindowsIdentity As WindowsIdentity
ImpersonateValidUser = False
If RevertToSelf() <> 0 Then
If LogonUserA(strUserName, strDomain, _
strPassword, _
LOGON32_LOGON_INTERACTIVE, _
LOGON32_PROVIDER_DEFAULT, token) <> 0 Then
If DuplicateToken(token, 2, tokenDuplicate) <> 0 Then
tempWindowsIdentity = New WindowsIdentity(tokenDuplicate)
ImpersonationContext = tempWindowsIdentity.Impersonate()
If Not (ImpersonationContext Is Nothing) Then
ImpersonateValidUser = True
End If
End If
End If
End If
If Not tokenDuplicate.Equals(IntPtr.Zero) Then
CloseHandle(tokenDuplicate)
End If
If Not token.Equals(IntPtr.Zero) Then
CloseHandle(token)
End If
End Function
Public Shared Sub UndoImpersonation()
ImpersonationContext.Undo()
End Sub
End Class
Now the methods you are going to use are ImpersonateValidUser (with this giving a username and password, domain if required, if no domain only give an empty string as parameter) and UndoImpersonation. The username and password is a user that’s on the server your application is running.
How to use it, when you need to run a piece of code that needs impersonation, call ImpersonateValidUser, and under it what you want to do and then again UndoImpersonation. I have found that when not undoing the impersonation reports will not load on your website, an error saying report in use, only reason for this I can think of is that the asp user is allready using the reports and when you impersonate that user is also trying to use the report.
Now the thing I was trying to accomplish was to print to a client pc automatically. The only way for this to happen is when the server can get access to the clients pc, thus sharing it.
The only problem I have is on one of the printers I was trying to use I keep getting a error, RPC server not running, so if anyone can give me a hand on this.
Thanks
|
|
|
|
|
how can i open excel document using asp.net...
is it possible to open using link button?
|
|
|
|
|
yes why not, we can open excel doc using asp.net , plz tell me ur detailed requirement so that i can help ypu out.
|
|
|
|
|
<td>
<a href="report1.xls" class="nav1">Report1</a>
</td>
when i click the above link button the excel document report1 is opened...
it located in my project itself...
now my need is if i click the link button...
i have to open a excel doc located in my D:
modified on Tuesday, February 10, 2009 11:37 PM
|
|
|
|
|
hi,
I am displaying images thumbnail in datalist. Now
I want to display clicked image with original size in another image tag contained in another div(which is invisible initially but can be visible on image click in datalist)
----------------------------
<asp:datalist id="ImageList" runat="Server" repeatdirection="Horizontal" repeatcolumns="5" width="10%" onitemdatabound="ImageList_ItemDataBound" xmlns:asp="#unknown">
<itemtemplate>
<asp:image id="imageGallery" imageurl="<%# Eval(" imagepath")="" %>"="" alternatetext="<%# Eval(" fullname")%>"="" runat="Server" imagealign="Middle" height="100" width="100">
|
<asp:image id="imageOriginalSize" runat="server" imagealign="AbsMiddle" xmlns:asp="#unknown">
----------
here in image id "imageOriginalSize" i wanna display original sized image.
|
|
|
|
|
I use a tag iFrame to embed a web page on another site.
But do not run on the Web I am not sussessful.Page Web I will embedded automatically run on its home page.
<body>
<iframe src="https://login.yahoo.com/config/login_verify2?&.src=ym"></iframe>
</body>
|
|
|
|
|
I don't think there would be a greater level of success with cross domain IFRAMEs, unless complex workaround procedures are forced and implemented.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
I am trying to pass values through soapcontext to my webservice
I am implementing my own customfilters (SoapInputFilter,SoapOutputFilter)
I am adding values to the soapcontext in the SoapOutputFilter of my application
and i am trying to read them in the SoapInputFilter of my webservice, but it return null
I have made all necessary configuration in my web.config file
<microsoft.web.services>
<filters>
<!-- note that you can add custom filters asymmetrically,
that is, just for output or just for input -->
<input>
<add type="InPutFilters,CustomFilters"/>
</input>
<output>
<add type="OutPutFilters,CustomFilters"/>
</output>
</filters>
</microsoft.web.services>
What may be the problem ?
|
|
|
|
|
I want all coding for grid view operations of update,delete,paging,sorting in gridview.
|
|
|
|
|
|
Hello,
I'm trying to show the date in the format: "10-10-2008 20:31" - like smalldatetime but without the second.
In a repeater control i have the code:
]]>
Can someone tell me how to trim the seconds?
|
|
|
|
|
Try
<![CDATA[<%#DataBinder.Eval(Container.DataItem, "Data","{0 : d}")%>]]>
|
|
|
|