Why is InfoPath letting me do edit controls in real-time? - infopath

This an odd error. Infopath is letting me to change (move around, delete, expand, etc.) controls of the form in real time as if I was in in design mode. It happens for a particular view, not all of them.
I don't want this. Does anybody know what could I've done to cause this and/or how to fix it?
Thanks!

I don't know what happened, but I copied the controls into a new view and that resolved the issue.

Related

On Updatepanel update, everything outside the updatepanel disappears

Apologies for such a broad, sweeping question, but I can't really give specific code examples because as far as I can tell from research this problem is unique to the particular page I'm working on and if I knew what to do to replicate it then I'd most likely be able to fix it.
I have an asp.net vb (v3.5 using the ajaxcontroltoolkit v4) page essentially binding some straight forward SQL database data to a gridview.
The gridview's in an update panel and whenever I do anything that causes a postback inside the update panel, everything outside the update panel vanishes. The update panel IS updating correclty.
There's no conditional updating, just an 'out of the box' update panel.
All other ajax functionality is working correctly, such as filtered textbox extenders and validation with callout extenders, so I don't think it's a basic script reference error.
I'm making use of javascript and jquery to modify controls on the fly that are within the updatepanel.
It was a standalone page for development but for testing this problem I put it into a contentplaceholder on a masterpage. Now on updating, everything else in the contentplaceholder disappears, leaving the masterpages header etc present.
If you haven't come across this particular problem before, can you think of how I could go about debugging it?
If you have any ideas at all, it might be enough to set me down the right path.
Many thanks.
Thanks for taking the time to make suggestions Mt. Schneiders.
In the end...haha wow, embarrassing... I've been doing this for the best part of 6 years now and I was closing my updatepanel before closing a div that started above the panel.
Simple fix. Yay! Thanks again.

ASP.NET dynamic controls data exchange in postback

Please excuse me for a probably low quality of this question, since I'm not a web dev, so I possibly don't now some obvious things and don't know what to Google for. I think problem must have some simple solution, but I'm struggling with it for two days now, so I feel myself pretty stupid :-).
I have a custom control which is a set of checkboxes which are added dynamically based on a property which is set in OnLoad event of a page. I have two such controls on a page and second control items should be based on items selected in first control.
The problem is, I can't figure out, how to catch on autopostback which boxes were selected in first control before second contol is constructed to pass this data to it?
Take a look at this.
http://forums.asp.net/t/1440174.aspx
Since your building them dynamically, they are not as easy to find as webforms would like to be, if you added them to the page and wired up events and such.
Your going to look at the Request.Forms list, and search thru it for any controls you want.
I believe checkboxes are like radio buttons, they only return if they are checked, which is good, cause you want to know which ones were checked.
I've used same solution as in the accepted answer for this question: Dynamically Change User Control in ASP.Net , just need to assign an unique id for each dynamically created CheckBox in custom control. Not as clean solution as I want but at least it works.
You can save the data in the ViewState, QueryString or as Session before moving to the next page and you can do modifications based on it.

CSS Dropping For Certain Controls

We have a pretty complex application design with a bunch of telerik controls. Every now and then, we get issues where the associated CSS to a file are lost, and the controls are not styled. So for instance, after an async postback (a couple of postbacks into the life of the page), the CSS for the textbox, date picker, combo, and other controls are lost. It's not complete; some controls still appear as they normally do, I don't think it's all inclusive.
Any idea why and how I can debug, and determine why they get lost? Anything I can do to work around it?
Thanks.
Brian
Have you tried the RadStyleSheetManager?
RadStyleSheetManager can help, but statically defining the CSS is the solution to this weird problem. RadStylesheetManager also gets references to the control dynamically and would have the same problem.

Registering a dynamic javascript after an UpdatePanel's update

I have a page with a dynamicly created javascript (the script is pretty static really, but the value of its variables are filled based on user input).
The result and the controls to take user input is inside an UpdatePanel which updates itself on certain user intputs. Some of these userinputs cause changes in the variables i spoke of earlier so i need to register a new javascript.
The problem ofcourse is that only the updatepanel gets updated and the scripts are registred outside the update panel so no new scripts are added.
What do you think would be best practice now? I could solve this by letting this script (and variables) live inside the updatepanel or i could make sure the page is fully reloaded when the need for posting a new javascript arises? The ScriptManager that i already have on the page might be able to help me with this...
So i'm looking for someone who either had similar problems and solved them in a nice way, or just someone with some bright ideas :)
Have a look at ScriptManager.RegisterClientScriptBlock.
I've had better luck with ScriptManager.RegisterStartupScript than I did with ScriptManager.RegisterClientScriptBlock. You might give that a shot.
Why not just put the variables inside the update panel, or have the JavaScript get the values through the DOM?

Best way to simulate 'SelectedIndexChanged' for ASP.NET DropDownList control with ViewState disabled

I've found many posts where people try to work around the problem of SelectedIndexChanged not working when EnableViewState='false'.
Im a little confused why control state doesnt kick in and allow it to work, but thats bonus points if anyone can explain that too.
Some of the 'hacks' are pretty 'hacky'. Like setting a value on the viewstate of the page itself corresponding to the dropdown value and then comparing that value with the one that is received durin the postback.
I'm lookin for the best most elegant solution (if there is a good one).
I dont know if this would be a clever derived control or something cleverer, but I want to make sure the solution is generic enough to be 'trustable' and not just a hack that only works for the specific page in question (which is common for such hacks!).
If you really want to know why and how this works, I'd suggest the following article:
TRULY Understanding ViewState
It's not an easy read, but does cover all the problems that people commonly encounter with viewstate. And it covers why everything works if you populate in Page_Init as opposed to Page_Load.
Bind the list before adding it to the control collection (not after as above commenter says).
-author of said article :)
Try loading your data into the DropDownList at an earlier point. Ie. in InitComplete. I haven't tested it, but I think that should do the trick.
EDIT:
It didn't do the trick. I've tested it, and it doesn't work satisfactory. As Ken Browning noted in another answer on this question, the SelectedIndexChanged event is ALWAYS fired if the SelectedIndex is any other than its initial value.
Why isn't SelectedIndex stored in ControlState instead of in ViewState. Can we trick ViewState to only keep track of SelectedIndex, while not storing the Items collection?

Resources