ラベル master の投稿を表示しています。 すべての投稿を表示
ラベル master の投稿を表示しています。 すべての投稿を表示

2012年3月24日土曜日

Returning a Form for Master Detail pages.

So I am trying to do something in .NET with AJAX that I do rather easily in jsp. It seems like such a common thing, I can only assume that I am just not googling the right terms, and any help would be apreciated. Here's the scenario:
Standard master detail says show a list of items, click one, be taken to a form to edit the item. What I'm looking for is the click on the link just populates the form for the proper item, which is rendered either below or to the right of the list. User edits the item, clicks a button on the form, the form is submitted (also just that region submitted, not the whole page), and a message for success or failure is shown.
I am able to do this with ease in jsp with several frameworks but am now working in the .NET arena and am having no end of trouble. I get as far as:
display the list
onclick call and ajax function (currently using AJAX.NET)
proper method gets called
I render a custom user control (contains a form) into an htmlTextWriter backed by a TextWriter backed by a StringBuilder, and I return that string to replace the content of a div on the page.
Several problems:
Why the need to jump through hoops with the various writers? Is there an easier way to just render a page snippet/custom control into the response stream?
Is there or will there be a facility to return server generated controls/control hierarchies from the server with Atlas?
What am I missing here? Any help would be greatly appreciated.
Thanks

You may want to try the refresh panel library:http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=cb2543cb-12ec-4ea1-883f-757ff2de19e8
Or wait for Atlas to implement similar features.
Thanks for the link - I'll check it out.

Rollovers with update panel not working?

Hello all,

I got a master page which containsjavascript generated by imageready for the rollover effect. I have acontent page which contains textbox, image button, updatepanel (Atlas)with Partial Rendering=True and gridview. Everything works fine in thebeginning. But once I sort, filter the grid view, the grid viewchanges as it should but now my rollovers don't work. I seems that thefunction that the onmouseover is not firing. I can still mess with thegridview that works fine. Oh yea the image button also has rolloverstate, that works but that is not calling the imageready function. Ithas inline javascript onmouserover="this.src='imgOver.gif';". I'malittle confused why the functions are not firing after the callback. Any ideas will be appreciated.

Thank YouPhotoshop's generated javascript uses a global boolean variable calledpreloadFlag. It sets this value to false globally, so I guess when a call back happens this line was being executed and sset back to false from being true. So none of the rollovers worked. I set it to true and the roll overs worked.

Hi boricua,

Here's a procedure you can adapt to your needs. Just call it for each ImageButton from the Page_Load. I've only tested this on IE 6, so let me know if it gives you any trouble.

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.LoadIfNot (Page.IsPostBack)Then

rollover3State(imgArrowLeft,

"ArrowLeft")
rollover3State(imgArrowRight,"ArrowRight")EndIfEndSubProtectedSub rollover3State(ByVal btnObjectAs ImageButton,ByVal baseImageAsString)

btnObject.Attributes.Add(

"onmouseout","{this.src='" &Me.ResolveUrl("App_Themes/" &Me.StyleSheetTheme &"/images/btn_" & baseImage &"_0.gif") &"';}")

btnObject.Attributes.Add(

"onmouseover","{this.src='" &Me.ResolveUrl("App_Themes/" &Me.StyleSheetTheme &"/images/btn_" & baseImage &"_1.gif") &"';}")

btnObject.Attributes.Add(

"onmousedown","{this.src='" &Me.ResolveUrl("App_Themes/" &Me.StyleSheetTheme &"/images/btn_" & baseImage &"_2.gif") &"';}")EndSub

Yeah this works. I used this method on some pages that I manually created, but for the ones that the html was created by imageready, which creates the javascript as well I fixed with the method I described earlier thank you dbDan.

2012年3月21日水曜日

RoundedCornersExtender Properties

Hi,

I'm just looking for how to dynamically set the color (for example) for a RoundedCornersExtender ("rceRightCol") I put on a Master Page, if I'm on a separate Content page. For example, i might want the color (rounded corners color attribute) to be red while on page1, but blue while on page2.

Thanks.

Change the setting in Page_Load of the sub-page?