|
Got that you are a beginner, but have you read anything on how grid row values can be selected and used?
Any book, tuorial? Google?
In button click event, you have to traverse row by row and insert in DB. Try first.
|
|
|
|
|
I got this error on postback the form after 20 minutes , i am using asp.net 3.5
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[CryptographicException: Padding is invalid and cannot be removed.]
....
......
[ViewStateException: Invalid viewstate.
Client IP: 122.162.81.11
Port: 50254
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19
ViewState: O8yx/NB6OwGsouM4ow3.....
please any one suggest?
|
|
|
|
|
Try disabling EnableViewStateMac Property from @Page directive.
EnableViewStateMac="false"
This may work. Just a guess.
|
|
|
|
|
can you please tell me hat is the need of linq and with simple example
|
|
|
|
|
|
Use what little intelligence you have left and do this sort of thing for yourself.
I can't believe someone gave you any information at all.
|
|
|
|
|
I got an mvc application and whenever I run my page and look at the output, there's a lot of empty lines. I know it's not that important but I want my page to be as small as possible. I tried using a WhiteSpaceRemoval Http Module but it removes all the whitespaces and newlines including the necessary ones.
Thanks a lot.
|
|
|
|
|
I have declared asp.net hyperlink under the TemplateField of the Gridview. How could I find the hyperlink in the code.
Thanks
<asp:TemplateField><ItemTemplate><asp:HyperLink ID="hyperLink1" runat="server" />
</ItemTemplate></asp:TemplateField >
|
|
|
|
|
You will have to handle the RowCreated event of the Gridview.
Within this event:
Dim HyperLink As HyperLink = TryCast(e.Row.FindControl("hyperLink1"), HyperLink)
I don't use GridViews but this should get you started.
|
|
|
|
|
Thank you Jason, I am looking into it.
|
|
|
|
|
Could you please give me any link to a real web page which currently uses Wep Parts, I know the technology but I would like to see it working in the practice.
Best Regarsrd
|
|
|
|
|
There are literally thousands of them, many you may not even be able to tell are using WebParts.
FJJCENTU wrote: I know the technology but I would like to see it working in the practice.
These statements are mutually exclusive. How can you claim to know the technology yet have not seen it in practice?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
My question has reference to that I have just done 3 Intranet projects, so I know how Web Parts work and how to work with them, but I never has seen other projects using Web Parts in Internet in order to get more utilizatión possibilities, so I simply try to see other Webs using Web Parts. I don´t think that it sounds so strange, at least for me.
|
|
|
|
|
I would like to display the result of an SQL query in a table: asp.net, please I need your advice, thank you
|
|
|
|
|
|
thanks, but I must respect what is asked
|
|
|
|
|
tek 2009 wrote: I must respect what is asked
What?
You do realize an ASP.NET GridView is rendered as a table right?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
and how can I do this?? what is required is to list the data in a control table: asp, but I failed to fill dynamically
|
|
|
|
|
Set the data you want to display as the Datasource for the gridview then use the Databind call. It's not overly complex.
Reference for you to read.
EDIT: Or use the Datasource control and bind to that but I don't like using that personally.
modified on Thursday, June 3, 2010 5:32 AM
|
|
|
|
|
tek 2009 wrote: please I need your advice
What advice do you need?
What have you tried?
1. Get data in a table or dataset from SQL Query...
2. Create a table, columns needs.
3. Traverse the dataset row by row and add it to the table!
Try it!
|
|
|
|
|
ok, thanks, i will be try it
|
|
|
|
|
Well done.
You've exhibited a staggering level of ineptitude and once again someone who is clearly incapable of searching for information themselves has got someone else to do the work for them.
If you can't even find info on this well covered subject may I suggest that you try an alternative career.
|
|
|
|
|
Hi,
I work on the code generation xml file I do not know how to modify it to populate the xml using a query sqlserver:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Text;
public partial class Etudiant11 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public class Etudiant
{
public int NumInscription { get; set; }
public string Nom { get; set; }
public string Prenom { get; set; }
public string CodeSexe { get; set; }
}
protected void Button1_Click(object sender, EventArgs e)
{
XmlSerializer serializer = new XmlSerializer(typeof(List<Etudiant>));
List<Etudiant> etudiants = new List<Etudiant>();
FileInfo fi = new FileInfo(@"C:\Temp\Etudiants.xml");
Etudiant etudiant = new Etudiant() { NumInscription = 123, Nom = "xxx", Prenom = "", CodeSexe = "M" };
etudiants.Add(etudiant);
etudiants.Add(etudiant);
etudiants.Add(etudiant);
using (MemoryStream mem = new MemoryStream())
{
serializer.Serialize(mem, etudiants);
using (FileStream fs = new FileStream(fi.FullName, FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
{
sw.Write(Encoding.UTF8.GetString(mem.ToArray()));
}
}
}
etudiant = null;
etudiants = null;
using (FileStream stream = fi.OpenRead())
{
XmlReader reader = XmlReader.Create(stream);
string str = reader.ReadInnerXml();
if (serializer.CanDeserialize(reader))
{
etudiants = (List<Etudiant>)serializer.Deserialize(reader);
}
}
foreach (Etudiant ee in etudiants)
{
Response .Write (string.Format("UPDATE ETUDIANT SET ETUDIANT_NOM = '{0}', ETUDIANT_PRENOM = '{1}', CODE SEXE = '{2}' WHERE NUM_INSCRIPTION = {3}", ee.Nom, ee.Prenom, ee.CodeSexe, ee.NumInscription));
}
}
} thanks
|
|
|
|
|
Do you mean you want to save an Etudiant to the DB or you want to populate an Etudiant from the DB?
|
|
|
|
|
You are trying to use an update statement on a geenric list of ETUDIANT objects. AFAIK, you cannot do this. Since your aim is to modify the XML file, you can make use of XmlDocument class.
|
|
|
|