|
Dont create DropdownList at runtime
place it in EditItemTemplate instead of TextBox
Find out it on RowDataBound Event of Gridview and bind it with datas
Best regard
Pathan
---------------------------------------------------
|
|
|
|
|
hi all,
I have a asp.net application where i display data in a datagrid from a datasource with some constraints. i need to convert the datas in the datatable as a pdf.
i want to do this without using any third party components.
Can anybody suggest me a link for implementing the same?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
|
Hey,
i don't know why, but i posted last night my question, and it seems to be deleted or something, and i have no idea why?
i will try to write it again: hope it won't be deleted....
i have a group of users which i want to be authorized to access my site.
and i want that anyone who is not in that group, will be redirected to a custom error webpage.
the problem is, that when i try to redirect him, it seems that he doesnt has any authorization to access my custom page.
i have 2 Web.Config files:
one for the all website which i set over there:
<authorization>
<allow roles="myWebSiteMembers">
<deny users = "*">
</Authorization>
<customErrors mode = "On" defaultredirect="Login/NoAccess.aspx">
<error statusCode = "401" redirect = "Login/NoAccess.aspx">
</CustomErrors>
and the other web.config i put in the Login folder, along whith the custom error page NoAccess.aspx
and this web.config has a <allow users = "*"> attribute alone.
the problem is that i don't get redirected and i get the default Access denied (asp.Net page) whith status code 401.2 explaning that i don't have access to the site.
also the url doesn't change so i think it means that he doesnt actually try to redirect to the otherpage.
hope you can help me to solve this problem fast,
Thanks alot.
p.s please do not delete this post, if it has errors or things againts the Boards rules,tell me and i will fix it.
Itay Levin
|
|
|
|
|
i want to validate a databound column and a template column in a datagridview.Databound colum i am displaying from database and in template colum i am allowing the user to enter a value.when user is entering value in template column i want to check whether the user enterd value is less than or equal to the value of databound column....How can i do this.........
Can anyone can help me...give some samples also........
Anu
Anu
|
|
|
|
|
anu,
In RowDataBound Event write this code
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
if (e.Row.RowType == DataControlRowType.DataRow)<br />
{<br />
int dbValue = (int)e.Row.Cells[0].Text;<br />
TextBox txtbox = (TextBox)e.Row.FindControl("TextBox1");<br />
txtbox.Attributes.Add("onblur", "validateValue('"+ dbValue +"','"+ (int)txtbox.Text +"');");<br />
}<br />
}<br />
add this javascript code in head section
function validateValue(dbvalue, enteredValue)<br />
{<br />
<br />
if(enteredValue < dbvalue)<br />
{<br />
alert("please enter the value equal or greate of column1 ");<br />
}<br />
}
hope this will help, as per the ur requirement fire this javascript validation related event.
regards
GV Ramana
|
|
|
|
|
How i can assignto gridview colum what i typed in template colum textbox
|
|
|
|
|
How can I perform uploading files to the webserver without refreshing whole page?
AJAX UpdatePanel and standard FileUpload do not work together...
|
|
|
|
|
you can read this article : http://www.codeproject.com/useritems/simpleajaxupload.asp
|
|
|
|
|
I didn't mean that. The question was how to organize asynchronous upload of the file.
|
|
|
|
|
|
Have you got any similar information that doesn't need knowledge of PHP?
|
|
|
|
|
sir i want navigate on other page when we click buttonfield column in the gridview.
thanks
|
|
|
|
|
write a javascript function & call that method onclick of that button.
common url for all buttons of grid ? or for each button different url ?
regards
GV Ramana
|
|
|
|
|
Hi,
I am Retrieving the binary image from sql database on web page. For that I have written following code in vb.net
Dim stream As MemoryStream = New MemoryStream()
Dim image As Byte()
Dim bitmap As Bitmap
Dim username As String
username = Session("memberuser")
con = New SqlConnection("server=ABC-0A55D6C3C90;database=satphere;uid=sa;pwd=")
Try
con.Open()
cmd = New SqlCommand("select photo from ViewProfile where userid = @userid", con)
cmd.Parameters.AddWithValue("@userid", username)
>>>>>>>>> image = CByte(cmd.ExecuteScalar())
stream.Write(image, 0, image.Length)
bitmap = New Bitmap(stream)
Response.ContentType = "image/gif"
'bitmap.Save(Response.OutputStream, ImageFormat.Gif)
bitmap.Save(Server.MapPath("TempImage/aa.gif"))
Image1.ImageUrl = "TempImage/aa.gif"
Catch ex As Exception
con.Close()
Stream.Close()
End Try
I am getting the error as
Value of type 'Byte' cannot be converted to '1-dimensional array of Byte'
line is mentioned by >>>>>>
C#.net code for same is working fine--------------as follwos
MemoryStream stream = new MemoryStream ();
SqlConnection connection = new SqlConnection(@"server=ABC-0A55D6C3C90;database=Test;uid=sa;pwd=");
try
{
connection.Open ();
SqlCommand command = new SqlCommand("select Picture from Image", connection);
byte[] image = (byte[])command.ExecuteScalar();
stream.Write(image, 0, image.Length);
Bitmap bitmap = new Bitmap(stream);
Response.ContentType = "image/gif";
bitmap.Save(Response.OutputStream, ImageFormat.Gif);
//bitmap.Save(Server.MapPath("TempImage/aa.gif"));
}
finally
{
connection.Close ();
stream.Close ();
}
can any one give me solution for this
Thanks to all
|
|
|
|
|
try this code
image = CType(cmd.ExecuteScalar(),Byte())
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
My knowledge of VB is rubbish, but I would say the problem is as follows:
cmd.ExecuteScalar() returns object, which is supposed to be array of bytes,
but your call CByte(cmd.ExecuteScalar()) is trying to convert this object into object of type byte (not array of bytes) and that causes your error.
Unfortunately, I don't know correct syntax in VB for casting object into array, I hope you do (otherwise you have to google it )
Pilo
|
|
|
|
|
Hi
In my application i need to save IP address of the system who accessing my
application or any user visit my site.
How can i get IpAddress of that system.
Thanks.
Rahul
|
|
|
|
|
Request.UserHostAddress
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
|
Request.ServerVariables["REMOTE_ADDR"]
|
|
|
|
|
ASP.NET Ajax doesn't support in .NET 1.1.
So, you have to choose other Ajax frameworks.. there are a lot of free ajax framework for ASP.NET 1.1. Check-out the link below if you interest..
Ajax Frameworks and Others.
If you are good at Javascript, you can probably use Prototype Javascript Library.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I have data I want to filter it according to 3 caracters. the problem is that it is in a details view control.
BiG RaLpH
|
|
|
|
|
details view control or data grid control ? From where does your filter criteria come from.
|
|
|
|
|
In the insertitemtemplate in the details view.
in the dropdownlist I can show the items all I need is to filter these items to a 3 char input from the user.
BiG RaLpH
|
|
|
|