|
i did try something that is working
mlDocument doc = new XmlDocument();
doc.Load("chores2.xml");
XmlElement elmXML = doc.CreateElement("day");
string strNewCat = "<a>" + this.txtBoxAmount.Text + "</a>" +
"<b>" + this.txtBoxPrice.Text +"</b>" +
"<c>" + this.txtBoxAbout.Text + "</c>" +
"<d>" + this.txtBoxSize.Text + "</d>";
elmXML.InnerXml = strNewCat;
doc.DocumentElement.AppendChild(elmXML);
doc.Save(Server.MapPath("chores.xml"));
but it build the xml file not as i need it to be
my question was how can i build it this way
<chores>
<day label="XXX">
<job a="1" b="2" ..="">
<job a="2" b="3".../">
<day label=XXX>
<job a="1" b="2"../>
<job a="2" b=3".../>
</day>
<day label=XXX>
<job a="1" b="2"../>
<job a="2" b=3".../>
</day>
|
|
|
|
|
If you are going to post code, please learn to format it. Look at the code block or inline code items above the textarea you used to write your post.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
does it really bother you..?
i asked for someone to help me with my code not to teach me how to format my code cuz i know how
|
|
|
|
|
|
YES it really bothers us. That's why there are those nifty convienent code block tags for you to use. And responses like this to long-term members will get you noticed, and no one will be willing to help you in the future. Even if it does have a smiley face at the end.
|
|
|
|
|
hi , iam using asp.net2.0 with c#
in my gridview iam at page load event iam displaying data from view.
my 1st column in the gridview is checkbox, when user selects the checkbox and iam using paging in gridview, when user
selects the checkbox and selects the rows from first page or from any page, that have to be stored in database.
in my database the table contains
orderid int primary key autoincrement
productname nvarchar
price nvarchar
quantity nvarchar
total nvarchar
when user selects the rows then in database how to store multiple rows in that table field
can you give an example which helps me.
|
|
|
|
|
What is the problem you are facing in saving the multiple rows.You have several ways to do it.
either you save it one by one ie call db one by one for all rows those are selected.
or another way you can,create the input in xml form and send to db and there parse the xml and save it in the table.
|
|
|
|
|
my problem is in there is a primary key
orderid int primarykey autoincrement
productname nvarchar()
price nvarchar()
quantity nvarchar()
total nvarchar()
iam displaying data in gridview at page load event.my gridcontains 1st colums is check box when users selcts multiple records
then in table orderid is primary key , and the selected multiple rows from gridview can we store in that fields . can you give me related example which helps me.
|
|
|
|
|
check this latest post for ur issue:
http://opexsolution.com/forum/viewtopic.php?f=15&t=21&p=70#p70
|
|
|
|
|
Hi Guys
I have a web app which is using windows authentication. In this app I have a report viewer control.
My problem is that when tested on my development machine, it works fine, but I get authentication errors when I try to view the reports on the app on the server.
I think this is because the report viewer control is trying to view the SSRS report using the servers credentials rather than the users windows credentials.
Does anybody know how I can pass the user credentials to the control to avoid the error?
(I don't want to use <identity impersonate="true" /> as not everyone should be able to view all reports)
Thank you,
oooo, the Jedi's will feel this one....
|
|
|
|
|
Hi,
I am opening an aspx page using the following code.From that aspx page,i will return some value using Response.Write("hi"); function.I want to get this string.How to get it from the aspx page to VC++.
CInternetSession objInetSession;
char szURL[100];
CStdioFile* objStdFile;
try
{
wsprintf(szURL,"%s","http://101.8.0.24/test/test.aspx");
objStdFile = objInetSession.OpenURL(szURL,1,INTERNET_FLAG_TRANSFER_ASCII ,NULL,0);
}
catch(CInternetException* exp)
{
exp->ReportError(MB_OK,0);
}
Thanks,
|
|
|
|
|
if you're starting up a web app project now, would you bother with ASP.Net or do with MVC?
thx
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
If you are a beginner then start with asp.net else with MVC
|
|
|
|
|
it depends upon your requirement of the client..!
If you want to start with MVC ,you have to complete it.Why to start without knowing that architecture.IMO start with Asp.net.
If you are trying to do an application for practice you can try with MVC.
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I agree with Gaurav Point.If you are new, start with ASP.NET else if you have good exposure with ASP.NET, you can go for MVC.
There is also a great comparison, have a look
|
|
|
|
|
I have created a custom user control using Visual Studio 2008. The user enters data in three TextBoxes. The data is added in a DataTable which is bound to a ListBox. The user has the option of deleting items from the ListBox.
The ListBox is declared as follows:
asp:ListBox ID="lstNames" runat="server" Height="99px" Width="245px"
EnableViewState="True"
onselectedindexchanged="lstNames_OnSelectedIndex"></asp:ListBox
Inside the function Page_Load I have the following"
if (!Page.IsPostBack)
{
...
lstNames.DataSource = table;
lstNames.DataTextField = "Display";
lstNames.DataBind();
...
}
I also have two buttons which allow me to add user input from TextBox controls to the ListBox and delete items.
My question is:
When I select an item and try to delete it, the SelecteIndex becomes 0 during the postback and the first item is removed (not the one I select). Basically, the SelectedIndex does not persist during a postback. I have looked at different postings here and other sites as well, searched MSDN but I cannot figure out the answer. Is there a way to overcome this problem and how?
Thanks!
Time is the fire in which we burn.
|
|
|
|
|
Probably because you're messing with the listitem collection within the dropdown, you do that, it'll get confused because as far as it's concerned, it's a new datasource and therefore there's no selected. How are you marking which one is deleted in your codebehind?
I'd probably create a seperate object to hold the data, use that as datasource for your dropdown and rebind each time otherwise there'll be a greater chance for state issues.
|
|
|
|
|
Thank you! That's interesting. Could you please elaborate a little bit?
I rebind the datasource every time the page is loaded. Are you saying that this is considered as messing with the listitem collection?
The code I use to delete the item is very simple (obviously I am trying to mark the item but I cannot):
int iIndex = lstNames.SelectedIndex;
if (iIndex > -1)
{
lstNames.Items.RemoveAt(iIndex);
table.Rows.RemoveAt(iIndex);
}
Every time I change the selection, I would like to retrieve the selected index. I cannot because during postback it is set to 0. I have tried to save the view state, but that did not work either. My problem is that I cannot get the selected index at any time at all. If at any point I could retrieve its value, I can store it somewhere. The problem is that I am reading 0 at all times. I don't know what to do.
Time is the fire in which we burn.
|
|
|
|
|
Odd, I've used that code similarly myself and it's been fine unless the dropdown was added dynamically.
Do you lose the selectedindex value if you remove the IsPostback check?
|
|
|
|
|
I lose the selectedIndex the moment I have some action that does a postback. I have tried to capture it in may places, during Page_Init, LoadViewState, SaveViewState, with the IsPostBack, and without it, etc. For the past two days, I have had no success.
...a little bit later...
I am starting to believe that it is a data binding issue. You were absolutely correct. When I remove the databinding code, everything works fine. I need to figure out why.
Time is the fire in which we burn.
modified on Thursday, April 8, 2010 2:42 PM
|
|
|
|
|
Hi,
are you sure, you dont rebind the datasource at any place on postbacks? I mean, obviously your items
still appear in your listbox after postback, you would have mentioned it otherwise.
So your control gets these items either from viewstate or by rebinding the datasource. If you rebind it
on postback, the selectedindex is lost, but the items would still appear. I would suspect that in the first place,
but in your code, i can see the "if (!ispostback...)" part.
Hmm. Maybe you rebind it in some event?
Good luck, these things can really make one scream.
|
|
|
|
|
Thank you! You are absolutely correct (yes, I rebind the datasource). I was seriously about to lose my mind. It never occured to me that that could be an issue.
Time is the fire in which we burn.
|
|
|
|
|
Hi,
I want to upload multiple image files from within an InsertItemTemplate within
a FormView. That Formview is placed in an UpdatePanel. I searched the net for
2 days to find answers to my problem. I am aware that a full postback is required
to make the asp.net FileUpload control work and that a PostBackTrigger has to be set
inside the UpdatePanel. My problem is that the PostBackTrigger button that I place in
the Triggers section of the UpdatePanel can not be found since it is declared in the
InsertItemTemplate. Can this be solved some way. I have read that in this case it is
better to use an AJAX AsyncFileUpload control, but I can not find any examples where
multiple files can be uploaded. I doubt that this is the best way to solve my problem
since the upload starts immediately after a file on the local file system is selected.
I want to start the upload only when the Insert Button inside the InsertItemTemplate is
clicked and therefore do the handling in the ItemInserting event of the FormView.
Can anyone please point me to an example where this is done. I can not imagine I am the
only one having this problem.
tia
|
|
|
|
|
I come from China, the English not very good, but I have an example, I use e-mail sent to you, this example can run, you can serve as a reference. Please tell me your email address.
|
|
|
|
|