Insert:    
Visibility:     Module:   
 
Register Login
Home    February 22, 2012
Spring on the Gulf Coast Minimize
Displaying 1-8 of 54 items.
Pirates CoveRelics
SunkTipsy
The CoveNice View
Conference CallDSC_8308_9_tonemapped.jpg
 
Daphne News and Headlines Minimize
Wed, 22 Feb 2012 18:32:59 -0600

Fairhope, Gulf Shores open baseball tournament with victories
al.com
Cole Wainwright (10) of Fairhope High places a bunt against Bayside Academy in the 15th annual Hank Aaron High School Classic at Daphne High on Monday, Feb. 20, 2012. (Press-Regsiter/Robert Ladnier) Hunter Slater of Bayside Academy pitches against ...

Wed, 22 Feb 2012 16:42:16 -0600

Reality TV World

'The Biggest Loser' eliminates returning contestant Daphne Dortch
Reality TV World
By Elizabeth Kwiatkowski, 02/22/2012 The Biggest Loser's thirteenth season eliminated Daphne Dortch during Tuesday night's broadcast of the NBC reality weight-loss competition's eighth episode. Daphne, a 37-year-old paralegal and kids activity team ...
Biggest Loser week 8 recap: One player switches up the teamsDigital Spy
'The Biggest Loser' –- Recap Feb 21 -- The Drama ContinuesGather.com
'Biggest Loser' 2012 Week 8 recap: Daphne stirs the pot, then gets kicked offThe Grand Rapids Press - MLive.com
CMR -TVGrapevine.com -Glencoe News
all 78 news articles »
Wed, 22 Feb 2012 14:18:01 -0600

Daphne wants to start fast in softball
al.com
Peyton Grantham is congratulated by Daphne head softball coach Lawrence Yelding after a home run last season. Grantham, a returning starter, hit .504 with 15 homers in 2011 and was named to the Alabama Sports Writers Association all-state softball team ...

Wed, 22 Feb 2012 02:44:51 -0600

Class 6A girls South Regional: Davidson 55, Daphne 47
al.com
MOBILE, Alabama -- Davidson center Shuntavia Harris ended Daphne's comeback bid by swishing a 18-footer with 1:26 to play, as the Warriors ended Daphne's 13-game winning streak by earning a 55-47 victory over the Trojans in today's Class 6A girls South ...

and more »
  
 
Foley News and Headlines Minimize
Wed, 22 Feb 2012 18:13:08 -0600

Foley, Robertsdale earn big opening-day wins in 15th annual BayBears Classic
al.com
SPANISH FORT, Alabama — Robertsdale and Foley's baseball teams managed to get off to a good start in the BayBears High School Baseball Classic. The Bears (1-0) knocked off Baldwin County 9-5 while the Lions (1-0) upended two-time defending 5A state ...
Baldwin County rallies late in BayBears High School Classic (roundup)The Huntsville Times - al.com

all 4 news articles »
Sun, 19 Feb 2012 13:44:05 -0600

Longtime volunteer coach Paul Zintel stands tall at Foley High
al.com
Paul Zintell, assistant basketball coach at Foley High School who holds the distinction of being elected to four different sports Halls of Fame. FOLEY, Alabama — Basketball coaches have come and gone over the years at Foley High School.

and more »
Sun, 19 Feb 2012 12:36:47 -0600

Fred's to build store; new Montego Bay restaurant to open
Press-Register - al.com (blog)
By Kathy Jumper, Press-Register FOLEY, Alabama -- First Choice Property & Development in Jackson, Tenn., paid $340000 for 1.5 acres on Ala. 59 in Foley and plans to build a 15000-square-foot Fred's Super Dollar Store with a pharmacy, according to Tim ...

Sat, 18 Feb 2012 21:15:25 -0600

Baldwin County High boys advance to 6A South Regional
al.com
FOLEY, Alabama -- Baldwin County's boys basketball team is headed back to the Mitchell Center after a year's absence. The Tigers (21-12) kept their season alive and advanced on to the 6A South Regional with a 60-51 victory over Foley (12-17) on the ...

and more »
  
 
Gulf Shores News and Headlines Minimize
Wed, 22 Feb 2012 16:29:56 -0600

Press-Register - al.com

5990- Gulf Shores Hangout Fest sells out of all tickets except VIP
MobileTribune.com (blog)
There's an ounce of truth to planning ahead and in the case of Gulf Shores,Alabama Hangout Festival this May18-20, that ounce is made of pure gold. All general admission tickets have been sold out. The early bird passes were gone weeks ago and regular ...
The Hangout Music Fest Sells Out General Admission TicketsWKRG-TV
Hangout Music Fest general admission sells out, some VIP tickets remainThe Birmingham News - al.com (blog)

all 8 news articles »
Wed, 22 Feb 2012 12:42:27 -0600

al.com (blog)

Annexation may be good news for businesses in Gulf Shores
al.com (blog)
By Kathy Jumper, Press-Register Exotic bird breeder Pam Vines feeds a walnut to a hyacinth macaw as she holds a scarlet macaw named Maggie at her aviary on Fort Morgan a few weeks ago. She was concerned that the new annexation rules would put her out ...

Mon, 20 Feb 2012 00:11:30 -0600

Daphne High fields young team baseball team in 2012
al.com
Daphne's Brandon Peterson (15) pitches against Gulf Shores at last year's BayBears High School Classic in Gulf Shores. Peterson, a senior, missed most of last season due to an injury but looks to return to his sophomore form where he posted a 9-2 ...

and more »
Sun, 19 Feb 2012 17:19:06 -0600

Revel with the Mystic Krewe of K9 Kritters
WALA-TV FOX10
GULF SHORES, Ala. (WALA) - The Mystic Krewe of K-9 Kritters Royalty will be chosen Monday, February 20, 2012, at the fifth annual fundraiser for the Baldwin County Humane Society (BARC!) at Magnolia by the Gulf Small Animal Clinic, 19930 Baldwin County ...

  
 
Orange Beach News and Headlines Minimize
Wed, 22 Feb 2012 16:38:59 -0600

Press-Register - al.com (blog)

Snowbird trivia night nets $10K for libraries
Press-Register - al.com (blog)
By Press-Register staff ORANGE BEACH, Alabama --- An overflow crowd of more than 400 attended the sixth annual Trivia Night held at Phoenix West to benefit the Gulf Shores and Orange Beach libraries. The Missouri Club held its sixth annual Snowbird ...

Sun, 19 Feb 2012 12:32:47 -0600

al.com (blog)

Mirams make a splash with Orange Beach parade
al.com (blog)
By Kathy Jumper, Press-Register Participants and revelers with the The Mystical Order of Mirams toss throws to the crowds gathered on Perdido Beach Blvd. Friday,in Orange Beach, Ala. The pre-Lenten blowout continues along the Gulf Coast culminating in ...

and more »
Wed, 15 Feb 2012 13:28:42 -0600

Press-Register - al.com (blog)

Insurance industry touts statewide building codes for Alabama
Press-Register - al.com (blog)
By George Altman, Washington Bureau In a Thursday, Sept. 16, 2004 file photo, buildings destroyed by Hurricane Ivan are seen in Orange Beach, Alabama. (AP Photo/Joe Cavaretta, File) The creation of statewide building codes in Alabama is key to solving ...

Wed, 15 Feb 2012 12:27:46 -0600

Press-Register - al.com (blog)

Baldwin County beach cities don't agree on school funding request
Press-Register - al.com (blog)
By Kathy Jumper, Press-Register ORANGE BEACH, Alabama -- School funding for an innovative teaching concept has received unanimous approval from the city of Gulf Shores, while Orange Beach wants more data before it supports a $550968 request.
Big Bucks for Mac Books in Gulf ShoresWKRG-TV

all 3 news articles »
  
 
Robertsdale News and Headlines Minimize
Wed, 22 Feb 2012 18:13:08 -0600

Foley, Robertsdale earn big opening-day wins in 15th annual BayBears Classic
al.com
SPANISH FORT, Alabama — Robertsdale and Foley's baseball teams managed to get off to a good start in the BayBears High School Baseball Classic. The Bears (1-0) knocked off Baldwin County 9-5 while the Lions (1-0) upended two-time defending 5A state ...
Baldwin County rallies late in BayBears High School Classic (roundup)The Huntsville Times - al.com

all 4 news articles »
Wed, 22 Feb 2012 12:05:35 -0600

Lady Bears starting over again in prep softball
al.com
ROBERTSDALE, Alabama — Starting over has been a common theme for the Robertsdale High softball team. As Barry Roberts steps in for the 2012 season — the seventh different coach since 2002 — he will inherit a team that has only five seniors on the ...

Sun, 19 Feb 2012 17:19:06 -0600

Revel with the Mystic Krewe of K9 Kritters
WALA-TV FOX10
GULF SHORES, Ala. (WALA) - The Mystic Krewe of K-9 Kritters Royalty will be chosen Monday, February 20, 2012, at the fifth annual fundraiser for the Baldwin County Humane Society (BARC!) at Magnolia by the Gulf Small Animal Clinic, 19930 Baldwin County ...

Wed, 15 Feb 2012 06:26:32 -0600

al.com

HIGH SCHOOL SPORTS High School Sports
al.com
BC RAIN 3, SARALAND 1 (BOYS): Cory Brown, Deangelo Foy and Nkhrumba Overton scored for the Red Raiders (1-0). Austin Beatty scored for the host Spartans (0-1), who welcome Cottage Hill at 5 pm Feb. 28. ST. PAUL'S 5, BAKER 1 (BOYS): Yannick Wildraut ...

and more »
Mon, 13 Feb 2012 22:43:39 -0600

Margaret Janeen Chadwick Stokes
Brewton Standard
Mrs. Margaret Janeen Chadwick Stokes, 70, died Sunday, Feb. 12, 2012. She was a native of Northport, and a former resident of Brewton, before moving to Castleberry in 1983. She was a homemaker and of the Christian faith. She was preceded in death by ...

  
 
Recent Entries from Local Blogs Minimize
Jun 10

Written by: anomaly
6/10/2005 8:23 AM  RssIcon

In the July issue of MSDN Magazine, Dino Esposito provided an excellent article on allowing DHMTL in ASP.Net Controls.  This is a core concept for a project that I am working on,  so I thought I would share my particular solution to the problem.

First, the problem.   -- If you use DHTML and client-side scripting to manipulate server side objects, whatever attributes of those HTML elements that were changed since initial page render via DHTML will be lost on postback.   My particluar need for DHTML was related to allowing users to move controls around a webform (a form designer) and then saving the new X/Y coordinates of those controls for later use. 

Inspired from Mr. Esposito's article, I decided to model my solution using a single hidden field.   I wasn't excited about this approach but I did consider it to me a good alternative to the common approach of adding one hidden field per DHTML-manipulated server control.

Since my particular need was to capture X and Y coordinates of controls that have been moved around a webform, in the DHTML javascript events fired after the control is dropped into place, I added code to se custom attributes representing the current coordinates.   In this case dd.obj is whatever object was moved.

document.getElementById(dd.obj.name).setAttribute("x",dd.obj.x);
document.getElementById(dd.obj.name).setAttribute("y",dd.obj.y);

This code adds the custom attributes, X and Y to the DHTML layer that was dragged to a new location.   Now, I must be able to persist these custom attributes through the postback.

To the webform, or an external .js referenced by the webform, I added a javascript function to enumerate through all attributes for all divs and set a hidden field's value to a text string that we will be able to reverse engineer on postback to re-set those attributes. (Or, do whatever we would like)

function setAttribState(hiddenID){
 var attribState="";
 //Which HTML tags should we include in attribstate?
 //Div only for now.
 var tagnames = new Array();
 tagnames[0]='div';
 
 for(var h=0;h  var elem = document.getElementsByTagName(tagnames[h]);
  for(var i=0;i   var thisElement ="";
   var attribs = elem[i].attributes;
   var eleAttribs="";
   for(var j=0;j    if (attribs[j].specified){
     var thisAttrib = "";
     var thisAttrib = attribs[j].nodeName + ':' + attribs[j].nodeValue;
     eleAttribs += thisAttrib;
     if (j!=attribs.length-1){eleAttribs+=','};
     }
   }
   thisElement = elem[i].id + '/' + eleAttribs;
   attribState += thisElement;
   if(i!=elem.length-1){attribState+=';'};
  }
 }
 document.getElementById(hiddenID).setAttribute("value",attribState);
}
To the webform, add a hidden field called "__attribState".
Then, in the codebehind for the webform  I wired this javascript into the submit button's onclick event.
I did this by adding this to the page_load event: 
Button1.Attributes.Add("onclick", "setAttribState('__attribState')")
 In the same codehind, under the form click event, I added a call to iterate through the text and set the attributes.
 ReadAttribState("__attribState")

To the webform, I added the sub:

    Private Sub ReadAttribState(ByVal HiddenControlName As String)
        Dim hiddenctl As HtmlControls.HtmlInputHidden = CType(Page.FindControl(HiddenControlName), HtmlControls.HtmlInputHidden)
        Dim elements As String() = Split(hiddenctl.Value.ToString, ";")
        Dim element As String
        For h As Int32 = 0 To elements.GetUpperBound(0)
            Dim x, y As String
            Dim ctlId As String = Split(elements(h), "/")(0)
            Dim ctl As HtmlControls.HtmlGenericControl = Page.FindControl(ctlId)
            Dim attribs As String() = Split(Split(elements(h), "/")(1), ",")
            For i As Int32 = 0 To attribs.GetUpperBound(0)

                Dim attribName = Split(attribs(i), ":")(0)
                Dim attribValue = Split(attribs(i), ":")(1)
                If LCase(attribName) <> "id" Then
                    ctl.Attributes.Add(attribName, attribValue)
                End If
            Next
        Next
    End Sub

 Voilà.   When your DHTML event fires, it will set your custom properties.   Then, onClick, the form button will build a text string of all attributes for all divs and populate the hidden field.  On postback, your code will poll this field, parse the name/value pairs for each attribute and re-set those attributes on page render. In my implementation, I then use these custom attributes to set the style of my controls on page_load.

Until Next Time,

Bill Dodd
mcp, mcsd, mcad, mcdba

Tags:
Categories:
Location: Blogs Parent Separator DoddBlog

1 comment(s) so far...


Gravatar

Re: DHTML & ASP.Net Controls

ugg boots outle is possible to keep Franny boots clean using a damp rag. The best a part of the faux leather and nylon upper is that salt stains won't set in. That is often a problem for footwear made of organic fibers. You only acquire winter boots once ugg boots sale each number of years, so decide on a pair that can last coach purses outlet. Sporto boots are durable and provide comfort with fashion flair.
Men and women looking for distinctive footwear might consider a pair of boots within a bright or distinctive colour. There are many options to choose from, but cheap coach purses red boots are becoming popular. This stunning footwear can be the perfect addition to any wardrobe. It's important to seek out boots which can be trendy, functional, and comfy.
Should you be looking for hiking boots, this Italian ugg outlet is actually a very very ugg classic short sparkles good spot to start out. They is situated in Northern Italy in which the Alps usually are not far. They've manufactured it their mission to make shoes and boots particularly for ugg outlet store. Asolo hiking boots are top coach outlet store online rated good quality and undoubtedly worth searching into coach purse outlet.
Probably the most comfortable pair ugg bailey button triplet I've ever owned is really a pair of black ugg bailey button sale, leather over-the-knee Franco Sarto boots. They offer a massive selection of all types and Report Footwear makes super trendy cost-effective ugg bailey button boots if you're trying to find slouchy boots or perhaps a pair of trendy ugg boots clearance highs having a heel. Each could be found at retailers like Macy's, Nordstroms and ugg bailey button triplet sale online. In case you prefer on the web shopping, try ugg boots sale which provides totally free shipping ugg classic short sparkles each approaches.
The lining extends for the ankle so you're warm from ugg classic short top to bottom when uggs for cheap wearing these footwear. The accessible zipper up the front in the boots tends to make it easy to eliminate them and slip them back on, even when you're wearing many ugg boots clearance or probably carrying some added winter weight. A mix of faux leather and quilted nylon produces a pair of boots that could make it through harsh climate. ugg boots sale For those who've dealt with blizzards or snowstorms, you realize a shoe that may make it by means of this kind of situations is necessary.
The final design is a simple flat soled boot. Generally a basic design will probably be lined within. They cease just past the ankle, but could also go midway up the calf cheap uggs. Some have laces, whilst other uggs on sale people slip onto the foot. Basic boots are perfect for people who live in cold climates and are searching for a enjoyable addition to their footwear collection.

By DFSDF on   12/3/2011 12:32 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
 
Gulf Coast Photography: Bill Dodd on Flickr Minimize
Displaying 1-12 of 49 items.
Epcot: Japan [Explored]Golden Hour
Pier at the BayFort Morgan Fishing Pier
Seated Beneath Blue Cotton [Explored]Nature's Litter
The Gulf Shores SunsetFairhope Pier Sunset from Overlook
The Good LifeThe Boardwalk @ Johnson Beach and a small tale. :)
A Good Way to End the DayFairhope Pier at Sunset
 
 Happy Holidays!   Terms Of Use  Privacy Statement