|
see if this article helps:
http://www.velocityreviews.com/forums/t113102-gridview-caption-style.html
|
|
|
|
|
I have the following code. Now this code is working for every row apart from the last one in the gridview, why would this be?
thanks
for (int x = 0; x < GridView1.Rows.Count; x++)
{
GridViewRow row = GridView1.Rows[x];
string strID = GridView1.DataKeys[x].Values[0].ToString();
HyperLink hyp = ((HyperLink)row.FindControl("hl"));
hyp.Attributes["OnClick"] = "alert('You do not have the correct permissions to perform this action');return false;";
hyp.ForeColor = Color.Black;
}
|
|
|
|
|
Fixed it, needed to put this code in the ondatabound event rather then on row create event
cheers
|
|
|
|
|
You mean to say that you are looping through all the rows of the gridview inside rowdatabound event?
Apurva Kaushal
|
|
|
|
|
|
I don't know why are you using like that becauise onrowdatabound event gets executed for all the rows of the gridview and if inside that event again if you are looping through all the rows then it seems unnecessary and also will cause a performance issue.
Apurva Kaushal
|
|
|
|
|
Hi,
I am checking users on my page load. If my condition fails, I have to stop the page loading and I dont want to display any of my controls too. For this purpose, I dont want to redirect my page. What I have to do. What about response.End
If I use response.end, I am getting error msg as "cannot obtain value". What I have to do?. Pls help.
Balasubramanian K.
|
|
|
|
|
BalasubramanianK wrote: dont want to redirect my page.
Ohh- redirecting to other page is a neat solution.
Put two panels, first panel contains all your controls and second one contains your error message which will be displayed when condition fails. Now toggle these panels visibility after checking the condition.
|
|
|
|
|
Thank you..
Balasubramanian K.
|
|
|
|
|
Hi,
you can put all of your controls inside a div and set it's visibility depending up on your condition.
<div runat="SERVER" id="divFull">
controls
</div>
divFull.Visible = condition;
Regards
Nirandas,
a developer from India.
|
|
|
|
|
Thanks for your reply..
Balasubramanian K.
|
|
|
|
|
Hi All,
Can you please share me the code to download file in ASP.net
Thanks in Advance
|
|
|
|
|
Kumar002 wrote: Can you please share me the code to download file in ASP.net
No
What do you mean download a file from sql server? you mean from the database yeah?
Do you want this to be a function that your users can perform?
|
|
|
|
|
try this code. i assume that file is stored in binary form in sqlserver
Const SQL As String = "SELECT * FROM Pictures where id=8"
Dim myCommand As New SqlCommand(SQL, con)
con.Open()
Dim myReader As SqlDataReader = myCommand.ExecuteReader
If myReader.Read Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + myReader("FileName"))
Response.ContentType = "application/octet-stream"
Response.BinaryWrite(myReader("ImageData"))
Response.End()
End If
myReader.Close()
con.Close()
|
|
|
|
|
Thanks for your reply,
I need to list all the files from that directory and from that list i should give a option to download the respective files.
actuvally i am a biginner so i dont have other chioce thatn posting these if you can give me an ex that wouls be great.
|
|
|
|
|
Kumar002 wrote: I need to list all the files from that directory
Use Directory.GetFiles() method. If you just provide a link to the file, it gets downloaded.
|
|
|
|
|
.fixedHeader
{
overflow: auto;
height = 10px
}
table th
{
position: relative;
top: expression(this.parentNode.parentNode.
parentNode.scrollTop-1);
}
using this css iam able to get the fixed header for my grid but the problem is that iam having a grid with the panel out side .. the grid view header is getting fixed but it going over the panel start point where it is not looking nice how to get the grid header with in the panel ..
|
|
|
|
|
and what is your question?
|
|
|
|
|
hii
Can anyone tell me which reference or namespace i use for ConfigurationNamingContext. my code is as below:-
Private Function ResolveNetBiosNameToDN(ByVal netbiosName As String) As String
Try
Return DirectCast(GetDirectoryEnTry(String.Format("CN={0}, CN=Partitions, {1}", netbiosName, DirectCast(ConfigurationNamingContext.Properties("distinguishedName").Value, String))).Properties("nCName").Value, String)
Catch ex As System.Runtime.InteropServices.COMException
If CInt(ex.ErrorCode) = 2147950640 Then
Throw New ArgumentException("The given netbios name was invalid", "netbiosName", ex)
Else
Throw
End If
End Try
End Functio
|
|
|
|
|
Hi All,
I have a web service developed using VS.Net 2005, when I put a break point in it and try to run it. It is not going to the break point it is not going into the function itself only. I am able to understand that it is becos of some settings but it will be helpfull if anybody can suggest me what settings do I need to change.
My application is not using Filesystem but http. Any sort of help will be very supportive. thanks in advance.
\
Aleem Mohammad.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Are you running the WS through browser by taking the URL directly ? If yes, the break points won't get hit. Make sure you are running the application via VS.
|
|
|
|
|
Hi,
Yes I am trying to run it through VS only still it is not going to the break point. Even I am also wondering. And below given is my Web.config file
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="PathToWriteXML" value="E:/Aleem/"/>
<add key="passWordXMLPath" value="E:/Aleem/"/>
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
Thanks,
Aleem Mohammad
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Are you able to "Step into" the code ? When you set break points and run the application, VS usually changes the break point color when it finds any problem in hitting it. You will get the error description if you move mouse over to that icon.
|
|
|
|
|
Hi,
No I am not able to get in to the code but the application is running and giving its output when it is called from another application. Please advise me.
Thanks for the help.
\
Aleem Mohammad
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: application is running and giving its output when it is called from another application
what do you mean ? Create a simple console application and try to step into the code (F11). If it's not working, I guess your IDE has some issues.
|
|
|
|