|
The problem isn't your code but rather how Ajax handles session. Have a look at here, maybe it will help
ASP.NET AJAX: State or no State?[^]
only two letters away from being an asset
|
|
|
|
|
hi all
i have a XML and want to convert following xml to word
Code:
<XML>
<para>C<sub>2</sub>H<sub>2</sub></para>
</XML>the output is C2H2
2 is subscript
can any one suggest me code
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
How does it related to ASP.NET?
|
|
|
|
|
You can use the Word ML[^].
A very simple solution would be write a xsl using the word ml and transform your xml using that.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thankx all for reply
can u give me an example manas ???
regards
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
how to save the webparts added by the users and how to show them again the webparts he selected in the before login.
|
|
|
|
|
lakshmichawala wrote: how to save the webparts added by the users and how to show them again the webparts he selected in the before login.
Ohh. You are talking about Web Parts personalization.
Here you go.
|
|
|
|
|
hi sir
i am using html link button in my gridview for expand/collapse of nested gridview depending upon some status like "S" and "A" and for remaining status the expand/collapse should not visible please tell me how i can do null that particular cell value for remaining status so that there are no any exapnd/collapse html button.
please send a demo if possible.
|
|
|
|
|
I have a grid view whose rows contain, a linkbutton and a textbox. The textbox is initially not visible.
If any linkbutton is clicked, then the text-box in the corresponding row has to be made visible.
I am able to do this with server-side event. But its introducing some delay which is very irritating to the user.
If a client-side script can do this, it will boost the site performance.
How this can be achieved with Java Scripts ?
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
Instead of making the textbox invisible, set the CSS display to none.
You can do this like
TextBoxName.Style.Add("display", "none");
Call a javascript function on the OnClientClick of the linkbutton and set the display as visible of textbox here.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i wrote it like this ...
<asp:LinkButton ID="lbkReply" runat="server" Text="Reply" OnClientClick="txtReply.Style.Add('display','none')" />
But, its not making the text box txtReply invisible ....
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
txtReply is the name on the server, it will have a mangled name on the client. Use txtReply.ClientID in server side code to emit the ID you need to use on the client. Even then, I thought you need to use document.getElementById("txtReply").Style.Add...
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I m devloping an online shopping website.........and in this i have to create menus in left side dynamically.....These menus will be created by the admin panel online....For e.g. First admin create Category then its sub-category and then product details and depending on these tree view menu will be created............i m totally confused which control to use create menu frm database and how to call information about specific product.........there can be n no. of categories and products..........shud i create a new page abt product everytime...........plz help me
Thank you
|
|
|
|
|
ankurdsharma wrote: .shud i create a new page abt product everytime.
No, that would be a mess. Create a single product page, which is passed an id and populates itself with a specific product from the DB, based on that id.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
I am creating a webapplication with three forms in asp.net/C# ,also I am using Sqlserver-2005.
In my application:
1)form(1) I am using a link button,and other textboxes plus buttons ; on its click the application will simply open a new form(form2); also I should tell you that I have alreday filled some textboxes in form (1) before clicking link button.
2)there are two text boxes in this form(2) and a button.
3)when the user clicks this button, all the text box data will be transferred to the form(1),and will be stored in textboxes there, also tthe user should also see the previous informations entered.
now the problem:
whenever I will run the application it will simply show an error message that form should have values coming from session id?
well, I tryed to solve it by simply copying form(1) as form(3)
form(1) wont have any data coming from form(2) and would simply send all its data to form(2), form(2) along with its data and form(1) data will be transferred to form(3)
any better technique of doing that
or
anyother suggestions or remedies?
thanks and regards
|
|
|
|
|
If you want to tell us what error you had, post the actual message. Pasting it into google is even quicker.
I'd make the forms controls on a single form, so viewstate can store the values for you, and you write code to move it between controls.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
HI Christian ,
consider the scenario below:
page(1)
session("empid")=txtempid.text;
textbox3=session("values").Tostring();
page(2)
txtempid.text= session("empid").Tostring();
session("value")=textbox3.text;
now simply consider this application to be running from page 1
|
|
|
|
|
Well, textbox3 will start with null, and if you go back and refresh, it will contain the text in the OTHER textbox3, given that you have two controls with the same names on two different pages. What is the issue ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
ok thanks for the answer, I didn't think about making it "null" oops!
shankbond
|
|
|
|
|
Hi
Im having a nightmare with a postback sequence so hopefully someone can give me ideas on how to solve this.
Hopefully I will be able to explain my issue correctly.
I have a Repeater on a page which contains a User Control in its Item Template
The User Control has (among other things) a place holder control.
Another user control is loaded dynamically with LoadControl (based on a database id) and added to the placeholder.
So basically I end up with
Repeater
- UserControl (PageComponentController)
-- DynamicUserControl
- UserControl (PageComponentController)
-- DynamicUserControl
etc
Repeater_ItemDataBound Snippet
CMS.Controls.PageComponentController pagecomponentcontroller = (CMS.Controls.PageComponentController)e.Item.FindControl("PageComponentController");
if (pagecomponentcontroller != null)
{
pagecomponentcontroller.PageComponent = pagecomponent;
pagecomponentcontroller.EditMode = _editmode;
pagecomponentcontroller.Zone = _zone;
pagecomponentcontroller.VirtualPage = _virtualpage;
}
PageComponentController onLoad Snippet
_component = (CMS.Components.BaseComponent)LoadControl(_pagecomponent.Component.UserControlPath);
if (_component != null)
{
_component.PageComponent = _pagecomponent;
_component.EditMode = _editmode;
_component.VirtualPage = _virtualpage;
_component.Zone = _zone;
phComponent.Controls.Add((UserControl)_component);
}
The UserControl (PageComponentController) contains two buttons "Edit" and "View"
Which then sets a property inside DynamicUserControl
This property is saved to the ViewState of the DynamicUserControl
public DAL.ComponentViews View
{
get
{
Object o = ViewState["COMPONENTVIEW"];
return (o == null) ? DAL.ComponentViews.View : (DAL.ComponentViews)o;
}
set
{
ViewState["COMPONENTVIEW"] = value;
}
}
First problem is this viewstate is not remembered (always null) on postback so the control always displays its default state rather than the selected view. All the controls are populated again and show, but not the correct state. Is there anyway to save the state of dynamically loaded controls?
Also, is it possible to tell which dynamic user control fired the postback?
With a postback all the page_loads fire for all the controls on the page.
The events wire up correctly (for the most part ) but i need to know in the page_load of the dynamic control not just if a postback occurred by if the postback was fired by that particular control.
Is there a way to do this?
Thanks
|
|
|
|
|
Tyrone Watt wrote: Is there anyway to save the state of dynamically loaded controls?
Sadly, your controls need to be created BEFORE page load, in order to participate in the reconstruction of the viewstate tree. Otherwise, the values are dropped. The alternative, is to store a hidden field in your page, and have javascript store the state of controls in that, because then you'll have something to set the state with, when you recreate the controls.
Tyrone Watt wrote: Also, is it possible to tell which dynamic user control fired the postback?
Same issue, really. No click event, unless the control existed before page load.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi
Thanks for that.
I have no problem creating the controls in PageInit instead but either way that doesnt seem to be the case.
The click event fires correctly after the page load, and the viewstate is set correctly in the "onclick" event, but it is not set in the page_load. So somewhere between the page_load and the onclick the viewstate is set back. Problem is I need to do things based on that viewstate before the click event or regardless of whether a click event occurred at all.
With the second question, maybe i didnt phrase it correctly. What I need to know is which particular control fired the postback in the page_load. So if i have 6 user controls on a page and control 3 fired the postback. On the page_load for the page and all 6 controls is there a way to tell that it was control 3 that did the postback, or is a javascript hack with a hidden field the only way.
As the event fires in the correct control, surely the must be some means of knowing which control fired the postback rather than just knowing that a postback occurred from one of the 6 controls.
Thanks
|
|
|
|
|
1 - if you create the exact same control tree, viewstate should be restored
2 - yes, I got that. If you have viewstate, then the sender property of the event is passed the control that fired it, so you can access it that way. In the absence of viewstate, you don't get an event at all. As soon as an event fires, cast the sender to the right type and then identify it from there.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
1. Thats what I thought, but its not... And as you mention in 2
Christian Graus wrote: In the absence of viewstate, you don't get an event at all.
Which puzzles me because the event fires, but the viewstate property is still null.
With 2, the "sender" in the onload is always the control itself, so unfortunately that doesnt help. Its in the onload that i need to know which control fired the postback, not in the onclick event(where the sender is the control that fired the event).
Thanks for you input so far, do you have any other suggestions i can try. Been beating my head against a wall for a while on this now and its starting to hurt...
|
|
|
|
|
Hi.. i want to convert datatime format to Date...i want to display On UI only date...
I am using below method its not working for me...
can anyone suggest me..
<br />
public static String GetShortDate(String sDateTimeValue)<br />
{<br />
return String.Format("{0:dd/MM/yy}", sDateTimeValue.ToString());<br />
}<br />
|
|
|
|