|
If it is link button, then the sender argument would help you with that right?
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!
|
|
|
|
|
Hi,
There is a label control on .aspx
The text "hello" comes from database i.e.
label1.text = "hello";
Note that, I do not have permission to change the UI code.
I would like to alter the value of the field in the table to show the text as bold i.e.
To have the text displayed as highlighted i.e. bold, I manually modified the text inside the field of the table to show
hello
Is this ok?
It does not seem to work because in the label control I see:
hello
Any thoughts please?
Thanks
|
|
|
|
|
The label renders as a span tag. Did you try manipulating it from JavaScript?
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!
|
|
|
|
|
Not sure.
Note that I do not have permission to change the UI code.
I can only change the database if required.
Thanks
|
|
|
|
|
hello,
While accessing the website at client side i am facing following errors:-
1. Sys.Forms.PageRequestManagerServerErrorException:An unknown error occured while processing the request on the server. The status code returned from the server was: 400
2. Sys.Forms.PageRequestManagerServerErrorException:An unknown error occured while processing the request on the server. The status code returned from the server was: 12152
I have tried so many options but finally i format the server and reconfigured it but still problem is still there.
please help out,
thanks in advance.
|
|
|
|
|
i am using stored procedure in my database class. suppose it(stored procedure) will give error
so how can i handle error?
|
|
|
|
|
by using raiserror in stored procedure.
|
|
|
|
|
I have several aspx forms in which I would like to change the postback behavior. The forms allow for paging and when I enter a new record the form posts back to the first record in the set instead of the record I just entered. Is there a way to change this? When I edit a record it posts back to the record I just editted. I would like the same behavior for a new record as well because several of my forms have a "sub-form" where I need to enter additional info and paging thru the records is a pain, or worse, I put the subform info with the wrong record. Below is the code from one of my forms. TIA - BJH
<asp:formview id="FormView1" runat="server" datakeynames="LocationID" datasourceid="FacilitySqlDataSource" allowpaging="True" xmlns:asp="#unknown"><br />
<edititemtemplate><br />
<table><br />
<tr><br />
<td><br />
LocationID:<br />
</td><br />
<td><br />
<asp:label id="LocationIDLabel" runat="server" text="<%# Eval("LocationID") %>"><br />
</asp:label><br /><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
LocationName:<br />
</td><br />
<td><br />
<asp:textbox id="LocationNameTextBox" runat="server" text="<%# Bind("LocationName") %>"><br />
</asp:textbox><br /><br />
</td><br />
</tr><br />
</table><br />
<br /><br />
<asp:linkbutton id="UpdateButton" runat="server" causesvalidation="True" commandname="Update"><br />
Text="Update"><br />
</asp:linkbutton><br />
<asp:linkbutton id="UpdateCancelButton" runat="server" causesvalidation="False" commandname="Cancel"><br />
Text="Cancel"><br />
</asp:linkbutton><br />
</edititemtemplate><br />
<insertitemtemplate><br />
<table><br />
<tr><br />
<td><br />
LocationID:<br />
</td><br />
<td><br />
<asp:label id="LocationIDLabel" runat="server" text="New"><br />
</asp:label><br /><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
LocationName:<br />
</td><br />
<td><br />
<asp:textbox id="LocationNameTextBox" runat="server" text="<%# Bind("LocationName") %>"><br />
</asp:textbox><br /><br />
</td><br />
</tr><br />
</table><br />
<br /><br />
<asp:linkbutton id="InsertButton" runat="server" causesvalidation="True" commandname="Insert"><br />
Text="Insert"><br />
</asp:linkbutton><br />
<asp:linkbutton id="InsertCancelButton" runat="server" causesvalidation="False" commandname="Cancel"><br />
Text="Cancel"><br />
</asp:linkbutton><br />
</insertitemtemplate><br />
<itemtemplate><br />
<table><br />
<tr><br />
<td><br />
LocationID:<br />
</td><br />
<td><br />
<asp:label id="LocationIDLabel" runat="server" text="<%# Eval("LocationID") %>"><br />
</asp:label><br /><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
LocationName:<br />
</td><br />
<td><br />
<asp:label id="LocationNameLabel" runat="server" text="<%# Bind("LocationName") %>"><br />
</asp:label><br /><br />
</td><br />
</tr><br />
</table><br />
<br /><br />
<asp:linkbutton id="EditButton" runat="server" causesvalidation="False" commandname="Edit"><br />
Text="Edit"><br />
</asp:linkbutton><br />
<asp:linkbutton id="NewButton" runat="server" causesvalidation="False" commandname="New"><br />
Text="New"><br />
</asp:linkbutton><br />
</itemtemplate><br />
</asp:formview>
|
|
|
|
|
u have to use formview and use insert and edit template for insert and update
respectively. bound linkbutton for delete and execute delete query when link of delete
will click.
keyur satyadev
|
|
|
|
|
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.
|
|
|
|