|
Do you have a web host that supports ASP.NET and SQL Server? I think the general consensus on these matters is that thats the first step.
|
|
|
|
|
yes I have the web host
what should I do?
|
|
|
|
|
our's is an online shopping and we are using more Response.Redirect statements with 3 to 6 parameters the sample code in my web application where iam getting the unknown error popup is
string Pn = txtProductName.Text;
string Bnd = txtBrandName.Text;
string fr = txtPrice.Text;
string to = txtPrice1.Text;
string Asp = "1";
string sr = "2";
//string Asb = "2";
// Response.Redirect("../userModules/ManageMores.aspx?ASe=" + Asp + "&As1=" + Pn + "&As2=" + Bnd + "&P1=" + fr + "&P2=" + to + "&sr1=" + sr);
Server.Transfer("../userModules/ManageMores.aspx?ASe=" + Asp + "&As1=" + Pn + "&As2=" + Bnd + "&P1=" + fr + "&P2=" + to + "&sr1=" + sr);
regards
chaitanya
|
|
|
|
|
the response.redirect looks ok to me!! what is the error description?
Gautham
|
|
|
|
|
Use Server.UrlEncode() method while attaching values.
ex :
Server.Transfer("../userModules/ManageMores.aspx?ASe=" + Server.UrlEncode(Asp).....
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Hi all
i want to update the xml file using datagrid
i am using dreamweaver 8.0 and coding in asp.net
i have the problem that i am notable to saving the updated value at the file
So
plz reply Quickly
|
|
|
|
|
import xml in to to data set,
do the changes
then
use...
dataset.writeXml
Ravi Kant Srivastava
(System Analyst)
HandsOn Technology & Engineering
Gurgaon
(India)
e-mail:ravikant@hte.co.in
|
|
|
|
|
Hi,
I have a gridview containing several rows of multi-column data. I've bound my grid from an ArrayList specifying bound fields on my gridview columns like this:
<asp:BoundField HeaderText="Price" DataField="SalesPrice" />
I can then read in cell/column data by indexing into the row and indexing to the column I need like this:
String str = (gvItems.Rows[i].Cells[0]).Text;
Knowing exactly which column it is, is error-prone so what I'd like to do is access my data knowing the datafield name, "SalesPrice". Can anyone suggest a good way of doing this?
Do I need to have a template?
|
|
|
|
|
hi
it is always better to use index than using the name. bcoz if the name is changed u have to modify everywhere wherver u use it. for huge projects it is a very tedious job. my suggestion would be that u better use index.
|
|
|
|
|
Thanks for your reply.
It is more likely for the column order to be changed rather than the name of the data field because the latter is what the gridview control is bound on.
The problem is that if the order of the columns changed, and the types of data were different as they are in my grid, the code would break. Whilst each column is a string value, some of those strings are actually numbers and I use a Parse method to parse them. If these methods tried to parse a string which wasn't actually a number, an exception would be raised.
Also, I pass the values to a method. If I use indexing, I have to arrange my parameters according to what position I read them in as, like this:
obj = new MyObject
(
(String)(gvItems.Rows[i].Cells[0]).Text,
(String)(gvItems.Rows[i].Cells[1]).Text,
(String)(gvItems.Rows[i].Cells[6]).Text,
Decimal.Parse((gvItems.Rows[i].Cells[2]).Text),
Decimal.Parse((gvItems.Rows[i].Cells[3]).Text),
Decimal.Parse((gvItems.Rows[i].Cells[5]).Text),
Decimal.Parse((gvItems.Rows[i].Cells[4]).Text)
);
It's far better to use the name if at all possible.
|
|
|
|
|
hi
the code varshavmane has sent would be more optimized one. did u try that one.
|
|
|
|
|
No, I don't want to refer to the index of the columns at all.
I need to retrieve the data based on the datafield name defined in the .aspx form.
|
|
|
|
|
how about: gvItems.Rows[i]["column name"].Text
Gautham
|
|
|
|
|
what would happen if column name is changed???
|
|
|
|
|
if the coumn name changes the code changes......
Gautham
|
|
|
|
|
change the code when the column name changes!!!!!
Gautham
|
|
|
|
|
gauthee wrote: gvItems.Rows[i]["column name"].Text
This doesn't compile unfortunately
|
|
|
|
|
If u just want to read the Gridview values then try this :
For intGridRowcnt = 1 To GridViewQuery.Rows.Count
If intGridRowcnt = GridViewQuery.Rows.Count Then
strWhereClause = strWhereClause & GridViewQuery.Rows(intGridRowcnt - 1).Cells(3).Text & " "
strWhereClause = strWhereClause & GridViewQuery.Rows(intGridRowcnt - 1).Cells(4).Text & " "
strWhereClause = strWhereClause & GridViewQuery.Rows(intGridRowcnt - 1).Cells(5).Text & " "
Else
strWhereClause = strWhereClause & GridViewQuery.Rows(intGridRowcnt - 1).Cells(3).Text & " "
strWhereClause = strWhereClause & GridViewQuery.Rows(intGridRowcnt - 1).Cells(4).Text & " "
strWhereClause = strWhereClause & GridViewQuery.Rows(intGridRowcnt - 1).Cells(5).Text & " "
strWhereClause = strWhereClause & GridViewQuery.Rows(intGridRowcnt - 1).Cells(6).Text & " "
End If
Next
|
|
|
|
|
The best thing i would recommend is as follows:
TextBox shorttitle = Bgt_Main.FooterRow.FindControl("txtshorttitle") as TextBox;
GridViewRow row= Bgt_Main.SelectedRow/
GridViewRow row = Bgt_Main.Rows[Bgt_Main.SelectedIndex];
TextBox shortt = row.FindControl("short") as TextBox;
Label mainid = row.FindControl("lblrow") as Label;
and then use:
shorttitle.Text/ shorrtt.Text/ mainid.Text
so the general syntax would be:
<controltype> = <gridview>..... as <controltype>
here "txtshorttitle","short","lblrow" are the ID's of the textbox/label's in the itemtemplate of the girdview/DetailsView.
Even if the column name changes like in Bind(..) or Eval(..) you dont have to change the code.
I hope this makes everything clear
Murthy here
|
|
|
|
|
Hi,
The requirement as follows:
A custom datagrid should be created, and mostly this should be in seperate cs file-so here all the properties of the datagrid should be maintained i guess!!!
Now at the front end[UI level] is hould use the custom datagrid whenevr required.
Any reference links,,,
Gautham
|
|
|
|
|
You could either create a user control (ascx file) or a custom control depending on your need. Plenty of links for both of these things on google...
|
|
|
|
|
User Control, the normal way to do things! however this is not the requirement, a datagrid should be there with all features like paging, sorting, etc etc. Now whenever required i should use this grid and could change props if wanted!! The remaining fetaures like adding template colmn, etc, etc.. should work too.
Tried google but that mission failed!!!
Gautham
|
|
|
|
|
i think either u r tryiing to re-inventing the wheel.
or not using the gridview properties properly...
ok do one thing pendown every thing, and start from first..
actually it is just like a small project...
Ravi Kant Srivastava
(System Analyst)
HandsOn Technology & Engineering
Gurgaon
(India)
e-mail:ravikant@hte.co.in
|
|
|
|
|
ravi,
let me make it simple firstly.
Whenevevr we use a datagrid we would get asp:datagrid1.....
here in this case it would be cc1:datagrid1.....
so, its a custom control, now when such control is used how about accessing properties etc etc
The custome control is re-usable but at the same time should be modifiable!!
did it help!!!
Gautham
|
|
|
|
|
Hello Everyone,
How can I develop a simple online radio using asp.net? Actually I'm looking for some cool tutorials. Please help me providing tutorials.
Mehedi Hasan
|
|
|
|