|
put your Primary Key in a hidden field in Template Field and get it by using find control for that row.
No, The hidden variable will be a child control of each row.
GridViewId.Rows[index].FindControl("hidden_field")
|
|
|
|
|
Map Primarykey values into Gridview Datakeynames Property. ex: DataKeyNames="<primarykey id="">"
int id = (int)gridview1.DataKeys[e.RowIndex].Value;
|
|
|
|
|
Set its width to 0px in the ColumnHeader attributes, and it will not be shown, but will still be accessible (since it's still actually rendered, whereas setting it to visible=false actually prevents it being rendered)
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hai
I have some n number of fileupload control in my site. During submission i need to save the file in some loaction and save file location in DB. So i write a single function to do this process and call the function for the n number of controls. To do so i am inneed to pass the file controls as args to that function. How to achieve this.
Thanks in advance.
modified on Tuesday, February 3, 2009 3:34 AM
|
|
|
|
|
Am I missing something, or are you asking how to write a basic method signature in .NET ? If you're talking about an event, you can't change their signatures. If you're talking about a basic method, what is the issue ? Also, you don't need to pass the file controls ( although you sure can ), you can pass the file data without passing the controls, if you need to.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi.
I need to put refrence of a HTMLForm (not the form itself) in a viewstate.
How can I do this?
Best wishes
|
|
|
|
|
Why on earth would you want to do that ? The form doesn't exist, how can you store a reference to it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
<asp:GridView ID="GridView1" runat="server" BackColor="#DEBA84" BorderColor="#DEBA84"
BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Total" Enabled="False" Height="278px" Width="515px" Font-Size="Large" OnRowDataBound="GridView1_RowDataBound" >
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField HeaderText="Article Subject">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" Font-Underline="True" Text='<%# Eval("TA_VC50_ArtName") %>' ForeColor="Purple" Visible="<%# true %>" PostBackUrl="default1.aspx"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Author">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("TA_VC50_ArtAuthor") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="marks">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Total") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle Font-Size="Large" />
</asp:GridView>
</td
|
|
|
|
|
anujbanka1784 wrote: Visible="<%# true %>"
What the hell is this ?
Define 'not working'. What is happening ? I am assuming the Text is not evaluting properly. Perhaps you need to use <%= ? I'm never sure, I just try different ones until it works...
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hai,
i am doing crm project.i upload the database, file and data in new server path.but old server working fine.it export csv file .but new server display error.what can i do ?if you know answer replay to me....
Thank you...!
|
|
|
|
|
hai,
Thank You.i assign provision on this folder.but still doesn't work .anymore solution you known ?
|
|
|
|
|
Is this URL within your website ? What code is trying to open the file ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hai,
Thank You.this folder inside server.this code is work fine in afxisi.net server.but today i did upload my files,db.data change in afxisi.org server so this server not support.
export csv coding
**********
System.Threading.Thread.Sleep(3000);
StreamWriter sw = new StreamWriter(Server.MapPath("Export\\contacts.csv"));
sw.WriteLine("{0},{1},{2}","Title", "First Name", "Last Name");
if (con.State.ToString() == "Closed") { con.Open(); }
SqlDataAdapter adp = new SqlDataAdapter("select title,firstname,lastname,officephone,mobileno,accountname,homephone,otherphone,fax,title1,department,donotcall,team,assignedto,emailprimary,secondaryemail1,secondaryemail2,secondaryemail3,primaryaddress,primarycity,primarystate,primaycountry,primaypostalcode,secondaryaddress,secondarycity,secondarystate,secondarycountry,secondarypostalcode,description,middlename,suffix,company,jobtitle,businessstreet2,businessstreet3,homestreet2,homestreet3,otherstreet,otherstreet2,otherstreet3,othercity,otherstate,otherpostalcode,othercountry,assistantsphone,businessfax,businessphone,businessphone2,callback,carphone,homefax,homephone2,isdn,pager,primaryphone,radiophone,ttytddphone,telex,aniversary,billinginformation,birthday,businessaddresspobox,categories,children,directoryserver,emailtype,emaildisplayname,email2type,email2displayname,email3type,email3displayname,gender,governmentidnumber,hobby,homeaddresspobox,initials,internetfreebusy,keywords,language,location,managersname,mileage,notes,officelacation,organizationalidnumber,otheraddresspobox,priority,private,profession,sensitivity,spouse,user1,user2,user3,user4,webpage,groupname,status from leads where groupname='" + txtgroupname.SelectedValue+"'", con);
DataSet ds = new DataSet();
adp.Fill(ds);
if (ds.Tables[0].Rows.Count > 0) {
for (int io = 0; io < ds.Tables[0].Rows.Count; io++) {
sw.WriteLine("{0},{1},{2}",ds.Tables[0].Rows[io][0].ToString(),ds.Tables[0].Rows[io][1].ToString(),ds.Tables[0].Rows[io][2].ToString());
}
}
if (con.State == ConnectionState.Open) {con.Close(); }
sw.Close();
string filename = Server.MapPath("Export\\contacts.csv");
Session["filenames"] = filename;
exportframe.Attributes["src"] = "./crmexport.aspx";
if you know any solution replay to me...
|
|
|
|
|
OK, you're sure you're able to set the file permissions on the server ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Chances are the user under which your code is running doesn't have permissions to the CSV. .NET may run under different users. I'd recommend adding read/modify on that file to the 'NETWORK SERVICE' and 'IUSR' permissions and try it again. Good luck.
Ranjit Viswakumar
Professional Services Specialist
HostMySite.com[^]
|
|
|
|
|
can you plz guid me.. I want to take backup of database containing 15 tables via XML File. And after that Restore it is well. plz help me I am using VB .net & SQL Server
|
|
|
|
|
AhmedNisar82 wrote: I want to take backup of database containing 15 tables via XML File
Sound like a terrible idea. The available backup options are not sufficient for you? How are you going to represent the constraints, triggers, procedures in XML file? You can use it only for representing the data.
|
|
|
|
|
Hello everyone!!!
Can anybody tell me how can i set the selectedIndex of dropdownlist whose AutoPostBack property is set to True,
I donot know what is i am doing but i need it .
That is the requirement .
or anyone may suggest me alternative way to do it.
but remember that dropdownlist having AutoPostBack=true
Thanks in advance
daTtA
|
|
|
|
|
Dattatraya Kale wrote:
Can anybody tell me how can i set the selectedIndex of dropdownlist whose AutoPostBack property is set to True,
I donot know what is i am doing but i need it .
I didn't what are you looking for. Can you please be clear?
You can changed the selected index by
DropDownList1.SelectedIndex = intIndex;
|
|
|
|