|
Hi ALl
I have one datagrid in asp.net.I generate columns in grid.
But i know how to add column in c# with asp.net like
DG.Columns.Add(SetStyle(new BoundColumn(),"Order","OrderID",""));
DG.Columns.Add(SetStyle(new BoundColumn(),"Order Date","OrderDate","{0 }"));
DG.Columns.Add(SetStyle(new BoundColumn(),"Required Date","RequiredDate","{0 }"));
but when i write this code in vb.net with asp.net ,it gives an error.
How can i write in asp.net?
if u have and,pls give me guidenece.
Thanks
monika
|
|
|
|
|
Remove semi-colon from end of the statement
Thomas
|
|
|
|
|
hi,
use
www.developerfusion.co.uk/Utilities/convertvbtocsharp.aspx
to change ur code from vb.net to c#.net.It may help u a lot
rupa
|
|
|
|
|
hi all
I have byte [] is a image (JPG) in database
I want show on System.Web.UI.WebControls.Image
some pepole say with me
Response.OutputStream but it will delete all my control in my pape
so i want give byte[] to System.Web.UI.WebControls.Image
some body help me
|
|
|
|
|
You can not include the image data in the same response as the page itself. You either have to save the data to a file, or use a proxy page that acts as a saved file by getting the data from the database and sending it as response.
---
b { font-weight: normal; }
|
|
|
|
|
HI
If you want to get the image from the database which is in the bytes and want to show on aspx page in image control ok
then you can do that what you have to do is first get the image from the database and store it in some temporary folder with extension jpg for that you have to do some conversion look at the code below
System.Drawing.Image newImage;
SqlConnection conn = null;
SqlCommand cmd = null;
DataSet ds = new DataSet();
SqlParameter UserNamedb = null;
SqlParameter AlbumNamedb = null;
conn = new SqlConnection(ConnectionString);
conn.Open();
cmd = new SqlCommand("GetAlbum", conn);
cmd.CommandType = CommandType.StoredProcedure;
UserNamedb = new SqlParameter("@UserName", SqlDbType.VarChar);
UserNamedb.Value = "SandeepAkhare";
cmd.Parameters.Add(UserNamedb);
AlbumNamedb = new SqlParameter("@AlbumName", SqlDbType.VarChar);
AlbumNamedb.Value = "ccccccccccccc";
cmd.Parameters.Add(AlbumNamedb);
SqlDataAdapter ad = new SqlDataAdapter(cmd);
ad.Fill(ds);
conn.Close();
string path = @"c:\AlbumFromdatabase" + "\\" + "SandeepAkhare";
Directory.CreateDirectory(path);
foreach (DataRow dr in ds.Tables[0].Rows)
{
Byte[] imageData = (byte[])dr[0];
string FilaName = dr[1].ToString();
using (MemoryStream ms = new MemoryStream(imageData, 0, imageData.Length))
{
ms.Write(imageData, 0, imageData.Length);
// newImage = Image.FromStream(ms, true);
Bitmap bm = new Bitmap(new MemoryStream(imageData));
newImage = bm;
newImage.Save(path + "\\" + FilaName);
}
}
|
|
|
|
|
Perhaps you should reply to the OP instead of replying to my reply.
---
b { font-weight: normal; }
|
|
|
|
|
|
Dear all,
My issue is that I don't want to submit the form is the checkbox isn't checked and i want to make it through validators
which validator should i use and how?
Best Regards
3ala2
|
|
|
|
|
|
i know!!!
But i can't control the button action
because i have other validators in the form
so i can do both together
anyway, i'm workin on something guess it should work...
Thanx for replying
Best Regards
3ala2
|
|
|
|
|
validation contrlos are predefined.genrally works on text boxes.it is not possible as per user by validation controls.if u realy want to validate u have to write seperate logic for that.by using script lagu..
|
|
|
|
|
I did it...
var ucName = "UcPayToAccountant1_";
function jsValidate()
{
if ( checkAmount() && checkDone() )
{
Page_ClientValidate();
return true;
}
else
{
return false;
}
} // End Function
function checkAmount()
{
var amount = document.getElementById(ucName + "txtAmount").value;
if ( isNaN(amount) )
{
return false;
}
else
{
return true;
}
} // End Function
function checkDone()
{
var done = document.getElementById(ucName + "chkDone");
if (done.checked)
{
return true;
}
else
{
return false;
}
} // End Function
added the onclick attribute the button
so using Page_ClientValidate(); function which the validator generates solved the probelm
Best Regards
3ala2
|
|
|
|
|
Hi,
I have created a web service(service.asmx). I have used basic windows authentication for web service. Please see my code which i had written in code behind.
TestWebService.Service ObjSer = new TestWebService.Service();
ObjSer.Credentials = CredentialCache.DefaultCredentials;
Label1.Text=ObjSer.HelloWorld().ToString();
But i got the following error...
"The request failed with HTTP status 401: Access Denied."
Could u please advise what is wrong with me?
Bye,
Poovarasan
|
|
|
|
|
Hi,
In page1, I am listing employee names in drop down list and selecting some name from the list. I am having one linkbutton in that page. when i click that button it takes to other page2 thro response.redirect. From that page2 when i click home link it comes back to page1 and in this page1 i have to retain the same value in dropdownlist but it shows only the first listitem in the dropdownlist. Please Help.
Thanks in Advance.
Regards,
Prya
|
|
|
|
|
When you fill DropDownList fill it inside Page_Load event use !Page.IsPostBack
example
<br />
if (!Page.IsPostBack)<br />
{<br />
}
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
Yes I am filling the list only in Page_Load under!(IsPostBack). My Code:
if (!(IsPostBack))
{
ddlEmpName.DataSource = loadEmployee;//loadEmployee-DataSet
ddlEmpName.DataTextField = "EmpName";
ddlEmpName.DataValueField = "EmpName";
ddlEmpName.DataBind();
}
Prya
|
|
|
|
|
Hi prya
write this code after bind Dropdown list.
DD.Items.FindByText(session["item"], String).ToString).Selected = True
U have to store selected item in session["item"]
Pathan
|
|
|
|
|
Why __VIEWSTATE comes in querystring?
Anyone have any idea and please reply as soon as. This is very urgent.
Thanks in Advance.
Regards
R.Arockiapathinathan
|
|
|
|
|
Hahaha, how can this be urgent... Viewstate can be a very very very powerfull tool for developing ASP.NET webpages. But you can switch them off using the page's EnableViewState property... is that quick enough for you??
|
|
|
|
|
I switched off enableviewstate in page level. But still getting viewstate hidden control.
And in our website, we are getting error log, it gives the request url, it says ....aspx?__viewstate=/.......
We never use postback option in all our pages. So how come this is possible?
Is it any hack attack?
Regards
R.Arockiapathinathan
|
|
|
|
|
Because you have changed the method of the form from POST to GET.
---
b { font-weight: normal; }
|
|
|
|
|
Hi ,
I am Ravindra, presently working with DataGrid control.
I added a checkbox column to my Datagrid control and like to delete rows which are checked.
So please help , how to get a particular row when the datagrid checkbox is checked.
This is the code I implemented
foreach(DataGridItem dgi in DataGrid1.Items)
{
CheckBox cb=(CheckBox)dgi.FindControl("CheckBox1");
if(cb.Checked==true)
{
}
}
thanks in advance...
-- Ravindra
|
|
|
|
|
do some modifications, like
if ctype(dgi.findcontrol("...").checked then
........
|
|
|
|
|
There is an error occured stating
Error Type:
Server object, ASP 0177 (0x8002801D)
Library not registered.
/includes/inc_FileUtilities.asp, line 28
In line 28 i write the coding like this
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Plz give me the solution
DPM
|
|
|
|