This has not been a really great week for me and ASP.NET...
I ran into this problem after fixing the other problem:
Page_Load event is firing twice - ExtremeExperts
So with that information, coupled with this information:
Stackoverflow.com - ASP.NET Page.OnLoad executes twice
...and this item from the Microsoft KB:
How to use the AutoEventWireup attribute in an ASP.NET Web Form by using Visual C# .NET
...I was able to solve this double-page-load problem since I was, in fact, wiring up events in a page that had AutoEventWireup set to "true" and the Page_Load was getting fired twice. Awesome.
Anyway, another bullet dodged.
Tuesday, November 24, 2009
Dynamically Created LinkButtons and UpdatePanel Woes
Check out my pain as described in this ASP.NET forum post:
Button command not working inside an UpdatePanel - ASP.NET Forums
Totally ridiculous how much work I had to do to get this function working.
Button command not working inside an UpdatePanel - ASP.NET Forums
Totally ridiculous how much work I had to do to get this function working.
Wednesday, November 18, 2009
ASP FileUpload Controller in AJAX Accordion - Stack Overflow
When working with ASP.NET, then ASP.NET AJAX, invariably you end up nesting all sorts of wacky controls inside one another.
I had been carefully avoiding putting a FileUploader inside an UpdatePanel since generally it means headaches because the FileUploader security model does not really fit into the AJAX model... maybe someday it will.
At any rate, I ended up with an FileUploader inside an Accordion inside an UpdatePanel, and of course, it stopped working since it needed a full postback, not an AJAX partial postback.
So this post on Stackoverflow.com is probably the most succinct solution to the problem I've seen and it totally makes sense:
ASP FileUpload Controller in AJAX Accordion - Stack Overflow
Here's the code:
I had been carefully avoiding putting a FileUploader inside an UpdatePanel since generally it means headaches because the FileUploader security model does not really fit into the AJAX model... maybe someday it will.
At any rate, I ended up with an FileUploader inside an Accordion inside an UpdatePanel, and of course, it stopped working since it needed a full postback, not an AJAX partial postback.
So this post on Stackoverflow.com is probably the most succinct solution to the problem I've seen and it totally makes sense:
ASP FileUpload Controller in AJAX Accordion - Stack Overflow
Here's the code:
<ajaxToolkit:AccordionPane >
<Header><asp:LinkButton ID="lbtnOption1" runat="server">Option 1</asp:LinkButton></Header>
<Content>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
/* Put HtmlInputFile and upload button here*/
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnUpload" />
</Triggers></asp:UpdatePanel>
</Content>
</ajaxToolkit:AccordionPane>
Monday, October 5, 2009
Slumming it with IUI and ASP.NET
With all the hype surrounding the iPhone, the SDK, and building applications for the App Store (which recently tipped the scale at 2 billion downloads), I'm taking a slightly different angle and am exploring "old-school" iPhone develompent: Web Development.
I was just mulling things over and it seems to me that there still is definitely a market (or rather, a need) for iPhone web applications.
So I'm investigating IUI, since it's relatively "mature" but the thing I'm concerned about is how well it integrates (or doesn't) with ASP.NET. So that's what I'm going to be exploring in the near future.
I was just mulling things over and it seems to me that there still is definitely a market (or rather, a need) for iPhone web applications.
So I'm investigating IUI, since it's relatively "mature" but the thing I'm concerned about is how well it integrates (or doesn't) with ASP.NET. So that's what I'm going to be exploring in the near future.
Labels:
.net,
apple,
applications,
asp.net,
iphone,
web development
Friday, August 14, 2009
Big Shout Out for Panic's Coda - Awesome Web Development Tool for Mac OS X
Over the last few days I've discovered Coda from Panic:
Panic - Coda - One-Window Web Development for Mac OS X
It is a truly awesome tool for doing web development and it does exactly what I want it to:
Panic - Coda - One-Window Web Development for Mac OS X
It is a truly awesome tool for doing web development and it does exactly what I want it to:
- By default it opens to the file system on the left pane, with the editor on the right
- It just works.
- It's code sensing (a la IntelliSense) is fun!
Wednesday, June 17, 2009
Notepad++: How to Associate Syntax Coloring for a File Extension
For the life of me, I could not figure out how to permanently associate the XML syntax coloring for files with a .config extension in Notepad++.
The help did not help, nor did the FAQs.
At any rate, this is how you do it:
Help the user out by doing one of the following:
The help did not help, nor did the FAQs.
At any rate, this is how you do it:
- Settings Menu --> "Styler Configurator" (which then displays the "Style Configurator" window (note the discrepancy)).
- Click on "XML" in the Language list on the far left.
- Notice at the bottom there are two text boxes: Default ext and User ext.
- Enter config in the User ext text box.
- Click Save & Close.
- Open a file with .config extension - file should be automatically highlighted.
Help the user out by doing one of the following:
- When an unrecognized file is opened ask what kind of file it is, or
- When the user clicks on an entry in the Language menu, save it as the default for files with that extension.
Monday, April 13, 2009
TIP: How To Fix ASP.NET CalendarExtender when used with Blueprint CSS
I just ran into a bizarre condition where, when using the Blueprint CSS with ASP.NET AJAX Toolkit, the popup calendar produced by the CalendarExtender control has its date numbers pushed out so I only saw about four or five days in each week.
It turns out that this is caused by the padding defined in Blueprint for TD elements are set to 5px. This expands the calendar so only part of it is visible in its containing div.
To fix the problem, I added a DIV called "calendarContainer" around the text box and the CalendarExtender control to "insulate" them:
...and then added the following to my CSS file:
The calendar dates snapped right back!
Problem solved!
It turns out that this is caused by the padding defined in Blueprint for TD elements are set to 5px. This expands the calendar so only part of it is visible in its containing div.
To fix the problem, I added a DIV called "calendarContainer" around the text box and the CalendarExtender control to "insulate" them:
<div id="calendarContainer">
<asp:TextBox ID="dateFromTextBox" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="dateFromCalendarExtender" runat="server"
TargetControlID="dateFromTextBox"></cc1:CalendarExtender>
</div>
...and then added the following to my CSS file:
div#calendarContainer table td {
margin:0px;
padding:0px;
}The calendar dates snapped right back!
Problem solved!
Friday, March 27, 2009
kuler: thank you, adobe...
Since I'm not a trained designer, it sure is nice that Adobe has created Kuler, which is a community driven collaborative environment for sharing colors and swatches:
kuler
(...you can even access it from within Adobe Illustrator. very cool.)
Colors are definitely one of those areas I have a big weakness, since I never studied color theory. So it's very nice to see the palettes and swatches other folks (i.e. competent designers) have created.
Thanks, Adobe!
kuler
(...you can even access it from within Adobe Illustrator. very cool.)
Colors are definitely one of those areas I have a big weakness, since I never studied color theory. So it's very nice to see the palettes and swatches other folks (i.e. competent designers) have created.
Thanks, Adobe!
Friday, January 30, 2009
ASP.NET Bug: Button.OnClientClick
I really don't understand this one.
According to the ASP.NET MSDN online documentation for Button.OnClientClick Property (System.Web.UI.WebControls), you use Button.OnClientClick to assign a client-side script (javascript) when the button is clicked (for example if you want to have the button perform some action(s) before submitting, or to short-circuit the click entirely).
However, I couldn't understand why the client-side onclick handler was not getting rendered, no matter what I tried!!!
Then I scrolled down to the bottom and noticed the comment by user contributor "Perley":
Mystery solved.
I had indeed set the button to be disabled in the markup, and it was flat-out not rendering the onclick handler in the HTML.
I fixed the problem by wiring up the onclick event for the button manually using a pageLoad function, but still it was a hassle.
I really think the people who designed, approved, and coded that "feature" should get their head checked, because, seriously... if a button is disabled initially, don't you think it's possible that the button - a user interaction device - might become enabled at some point, and not through server-side intervention???
According to the ASP.NET MSDN online documentation for Button.OnClientClick Property (System.Web.UI.WebControls), you use Button.OnClientClick to assign a client-side script (javascript) when the button is clicked (for example if you want to have the button perform some action(s) before submitting, or to short-circuit the click entirely).
However, I couldn't understand why the client-side onclick handler was not getting rendered, no matter what I tried!!!
Then I scrolled down to the bottom and noticed the comment by user contributor "Perley":
"MS has made it so that if you disable the button on the server then the onclick attribute is not even rendered to the client"
Mystery solved.
I had indeed set the button to be disabled in the markup, and it was flat-out not rendering the onclick handler in the HTML.
I fixed the problem by wiring up the onclick event for the button manually using a pageLoad function, but still it was a hassle.
I really think the people who designed, approved, and coded that "feature" should get their head checked, because, seriously... if a button is disabled initially, don't you think it's possible that the button - a user interaction device - might become enabled at some point, and not through server-side intervention???
Subscribe to:
Comments (Atom)
