Advertisement

07.08.2008 at 10:22PM PDT, ID: 23549133
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

web part is not properly functioning for first time

Asked by ajay1feb in Programming for ASP.NET, JavaScript, Asynchronous Javascript and XML (AJAX)

Tags:

i am using user control as web part in asp.net 3.5 application.whenever i am clicking on verb inside web part for first it is giving object expected error.when i click on verb second time it is working fine.what can be problem ?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
525:
526:
527:
528:
529:
530:
531:
532:
533:
534:
535:
536:
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
573:
574:
575:
576:
577:
578:
579:
580:
581:
582:
583:
584:
585:
586:
587:
588:
589:
590:
591:
592:
593:
594:
595:
596:
597:
598:
599:
600:
601:
602:
603:
604:
605:
606:
607:
608:
609:
610:
611:
612:
613:
614:
615:
616:
617:
618:
619:
620:
621:
622:
623:
624:
625:
626:
627:
628:
629:
630:
631:
632:
633:
634:
635:
636:
637:
638:
639:
640:
641:
642:
643:
644:
645:
646:
647:
648:
649:
650:
651:
652:
653:
654:
655:
656:
657:
658:
659:
660:
661:
662:
663:
664:
665:
666:
667:
668:
669:
670:
671:
672:
673:
674:
675:
676:
677:
678:
679:
680:
681:
682:
683:
684:
685:
686:
687:
688:
689:
690:
691:
692:
693:
694:
695:
696:
697:
698:
699:
700:
701:
702:
703:
704:
705:
706:
707:
708:
709:
710:
711:
712:
713:
714:
715:
716:
717:
718:
719:
720:
721:
722:
723:
724:
725:
726:
727:
728:
729:
730:
731:
732:
733:
734:
735:
736:
737:
738:
739:
740:
741:
742:
743:
744:
745:
746:
747:
748:
749:
750:
751:
752:
753:
754:
755:
756:
757:
758:
759:
760:
761:
762:
763:
764:
765:
766:
767:
768:
769:
770:
771:
772:
773:
774:
775:
776:
777:
778:
779:
780:
781:
782:
783:
784:
aspx page :
 
<%@ Page Language="C#" AutoEventWireup="true"  EnableEventValidation="false" ValidateRequest ="false"   CodeFile="DashBoard.aspx.cs" Theme ="default"  Inherits="Dashboard_TestPage" Buffer ="true" Async ="true" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 
 
<%--<%@ Register Namespace="MarkItUp" TagPrefix="portal" %>--%>
<%@ Register TagPrefix="CustomiseWebpart" Assembly="CustomiseWebpart.Web" Namespace="CustomiseWebpart.Web.UI.WebControls.WebParts"%>
<%@ Register Src="~/Controls/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/Footer.ascx" TagName="Footer" TagPrefix="uc2" %>
<%@ Register Src="~/Controls/Forecastgrid.ascx" TagName="Forecastgrid" TagPrefix="uc14" %>
<%@ Register Src="~/Controls/FlowProfileChart.ascx" TagName="FlowProfileChart" TagPrefix="uc6" %>
<%@ Register Src="~/Controls/PressureProfileChart.ascx" TagName="PressureProfileChart" TagPrefix="uc8" %>
<%@ Register Src="~/Controls/HydraulicProfiles.ascx" TagName="HydraulicProfiles" TagPrefix="HydraulicProfiles" %>
<%@ Register Src="~/Controls/Linepack.ascx" TagName ="LinePack" TagPrefix="LinePack" %>
<%@ Register Src="~/Controls/cmoniter.ascx" TagName ="cmoniter" TagPrefix="cmoniter" %>
<%@ Register Src="~/Controls/Trend.ascx" TagName="Trend" TagPrefix="Trend" %>
<%@ Register Src="~/Controls/Gauge.ascx" TagName="Gauge" TagPrefix="uc4" %>
 
<%@ Register Src="~/Controls/LeakDetectionStatus.ascx" TagName ="Leak" TagPrefix="uc5" %>
 
<%--<%@ Register Src="~/Controls/Unaccount3dchart.ascx" TagName="Unaccount3dchart" TagPrefix="UnaccYear" %>
<%@ Register Src="~/Controls/LeakSensitivity.ascx" TagName="LeakSensitivity" TagPrefix="LeakSen" %>
<%@ Register Src="~/Controls/AverageLeaksesitivity3dChart.ascx" TagName="AverageLeaksesitivity3dChart" TagPrefix="AvgLeakSen" %>
<%@ Register Src="~/Controls/Conditionsnow.ascx" TagName="Conditionsnow" TagPrefix="uc4" %>
<%@ Register Src="~/Controls/MyAlerts.ascx" TagName="MyAlerts" TagPrefix="uc9" %>
<%@ Register Src="~/Controls/unaccountedGasToday.ascx" TagName="unaccountedGasToday" TagPrefix="UnaccTody" %>
--%>
<%@ Register src="../Controls/ScheduleImbalance.ascx" tagname="ScheduleImbalance" tagprefix="SchImb" %>
<%@ Register src="../Controls/AllocationImbalance.ascx" tagname="AllocationImbalance" tagprefix="AllImb" %>
<%@ Register src="../Controls/RevenueByShipper.ascx" tagname="RevenueByShipper" tagprefix="Revenue" %>
<%@ Register src="../Controls/NetMargin.ascx" tagname="NetMargin" tagprefix="NetMar" %>
<%@ Register src="../Controls/ActualPosition.ascx" tagname="ActualPosition" tagprefix="ActualPos" %>
<%@ Register src="../Controls/DailyNetMargin.ascx" tagname="DailyNetMargin" tagprefix="DailyNetMar" %>
<%@ Register src="../Controls/ScheduledPosition.ascx" tagname="ScheduledPosition" tagprefix="SchdPos" %>
 
<%@ Register Namespace="InfoSupport.Demos.WebParts"   TagPrefix="CCZ" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>PipeView</title>
    
<script language ='javascript' >
 
function helpScreen()
{
    var Left = (screen.width/2)-100;
    var Top = (screen.height/2)- 100;
    window.open('../Help.aspx',null,'height=120,width=250,status=no,toolbar=no,menubar=no,location=no,top='+Top+',left='+Left);
 
}
 
</script>
    
</head>
<body style="background-image:url(../Images/main_bg.png)"  LINK="#EcEcEc" VLINK="#EcEcEc" ALINK="#EcEcEc"  >
    <form id="form1" runat="server">
      <div>
      <asp:ScriptManager runat="server" ID="ScriptManager2"  EnablePartialRendering="true"     >
      <Scripts >
      <asp:ScriptReference Path="../JavaScript/PageRequestManagerEx.js" />
       </Scripts>
      </asp:ScriptManager>  
      
       <script type="text/javascript">
            PageRequestManagerEx.init();
        </script>
 <asp:UpdatePanel ID="MainUpdatePanel"  runat="server"   UpdateMode="Conditional"  > 
    <ContentTemplate>
                <table  border="0" cellpadding="0" cellspacing="0" align="center"  class ="mainTable"    >
    <!--Header-->
    
    <tr>
    <td >
<table  border="0"  style="width:100%;height:85px;background-image:url(../Images/main_header_bg.png)">
<tr>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Image ImageUrl="~/Images/logo_pipe_view.png"   runat ="server" ID="PipeView"    />
</td>
<td  align="right" valign ="top"     >
<table border="0"  cellpadding ="0" cellspacing ="0" style="height: 100%">
<tr valign="bottom">
<td >
 
<table style="height:100%" border="0" style="font-family: Arial; font-size:10pt; color: #FFFFFF" cellspacing="3" cellpadding="0">
<tr>
<%--<td  ><a href="#"  ><font  color="white"> Profile</font>  </a> </td>
 
<td > | </td>--%>
<td >
<a  href="JavaScript:helpScreen();"  ><font  color="white">Help</font></a> 
</td>
<td > | </td>
<td  ><a href="../login.aspx"><font  color="white">Sign Out</font></a>
<br />
    </td>
</tr>
 </table>
 
</td>
</tr>
<tr>
<td>
<p>&nbsp;</p>
<p>&nbsp;</p>
</td>
</tr>
<tr  style="height:100%"  >
<td   align="right" >
<table  width="100%"  cellpadding="1"   >
<tr><td   >
<asp:DropDownList ID="cmbRegions" runat="server" AutoPostBack="true" 
         BackColor="DarkGray" Font-Bold="true" Font-Names="Arial" ForeColor="White" 
         OnSelectedIndexChanged="cmbRegions_SelectedIndexChanged" Height="20px" Width="150px"   >
</asp:DropDownList>
</td>
<td></td>
<td  >
 <asp:ImageButton ID="ImageButton1" runat="server"  BorderWidth="0" ImageUrl="~/Images/tab_.png" 
       OnClick="btnCustomize_Click"   />
  </td>
</tr>
</table>
</td>
</tr>
 
 
</table>
 </td>
</tr>
<%--<tr>
<td align ="right" valign =bottom >
</td>
</tr>--%>
</table>
    </td>
    </tr>
    
     <!--End Header-->
  
 <asp:WebPartManager    EnableClientScript="true"  ID="wpManager" runat="server"  OnWebPartClosed="OnWebpart_Closed"   >
 
 </asp:WebPartManager >
  <asp:Timer ID="Timer1" runat="server" Enabled="true"  >
        </asp:Timer>
    <!-- Catalog-->
     <tr>
     <td  style="background-color:Gray"   valign =baseline  >
     
     <table border="0" style="width:100% "  >
     <tr>
     <td  align ="left"  >
         <CCZ:DropDownCatalogZone  ID="wpCatalog"     width="100%" runat="server" BorderColor="Gray"  BackColor="gray"
                BorderWidth="1px" Font-Names="Arial" Padding="6" ForeColor="White"  HeaderText ="Click on Pipview widget to add it " >                                                                                                            
                <HeaderVerbStyle  Font-Bold="False" Font-Size="10pt" Font-Underline="False" ForeColor="#333333" />
                <PartTitleStyle BackColor="#898989" Font-Bold="True" Font-Size="10pt" ForeColor="White" />
                <PartChromeStyle BackColor ="Gray"   BorderColor= "Gray" BorderStyle="Solid" BorderWidth="0px"  />
                <InstructionTextStyle Font-Size="10pt" ForeColor="#333333" />
                <PartLinkStyle Font-Size="10pt" />
                <EmptyZoneTextStyle Font-Size="10pt" ForeColor="#333333" />
                <LabelStyle Font-Size="10pt" ForeColor="White" />
                <VerbStyle Font-Names="Arial" Font-Size="10pt" ForeColor="#333333" />
                <ZoneTemplate   >       
            <%--       <asp:PageCatalogPart   ID="PageCatalogPart1" runat="server"  Title="Click on any PipeView widget to add it "  />  --%>
            
                     <asp:DeclarativeCatalogPart   ID="DeclarativeCatalogPart2" runat ="server" Title="Grid Widgets">
                     <WebPartsTemplate>
                         <AllImb:AllocationImbalance Title="Allocation Imbalance"    ID="Table_AllocationImbalance" runat="server" />
                        <SchImb:ScheduleImbalance Title="Scheduled Imbalance"     ID="Table_ScheduledImbalance" runat="server" />
                        <Revenue:RevenueByShipper Title="Revenue By Shipper"    ID="Table_RevenueByShipper" runat="server" />
                        <NetMar:NetMargin  Title="Net Sales Margin"   ID="Table_NetSalesMargin" runat="server" />
                        <ActualPos:ActualPosition  Title="Actual Sales Position"   ID="Table_ActualSalesPosition" runat="server" />
                        <DailyNetMar:DailyNetMargin  Title="DailyNet Sales Margin"   ID="Table_DailyNetSalesMargin" runat="server" />
                        <SchdPos:ScheduledPosition  Title="Scheduled Sales Position"   ID="Table_ScheduledSalesPosition" runat="server" />
                        
                       <uc4:Gauge Title="Conditions Now" ID="Gauge_ConditionsNow" runat="server" />
                       <uc5:Leak   Title="Leak Detection Status"  ID="Gauge_LeakDetectionStatus"  runat="server" />
                       <cmoniter:cmoniter Title="Commercial Monitoring"    ID="Gauge_CommercialMonitoring"  runat="server"/>
                       <uc14:Forecastgrid   Title="Forecast"   ID="Gauge_Forecast"  runat="server"/>
                         
                      <uc6:FlowProfileChart      Title="Flow Only"  ID="Chart_FlowOnly"  runat="server"/>
                      <uc8:PressureProfileChart  Title="Pressure Only"    ID="Chart_PressureOnly"  runat="server"/>
                      <Trend:Trend   Title="Trend Widget" ID="Chart_TrendWidget"  runat="server"/>
                      <Linepack:LinePack Title="Line pack Forecast"  ID="Chart_LinepackForecast" runat="server" />
                      <HydraulicProfiles:HydraulicProfiles Title="Hydraulic Profiles"  ID="Chart_HydraulicProfiles"  runat="server"/>
                      </WebPartsTemplate  >
                    </asp:DeclarativeCatalogPart>
               
                </ZoneTemplate>
                <PartStyle BorderColor="gray" BorderWidth="5px"  />
                <SelectedPartLinkStyle Font-Size="10pt" />
                <FooterStyle BackColor="gray" HorizontalAlign="Right" ForeColor="White" />
                <HeaderStyle BackColor="gray" Font-Bold="True" Font-Size="10pt" ForeColor="#333333" />
                <EditUIStyle Font-Names="Arial" Font-Size="10pt" ForeColor="#333333" />
                <CloseVerb ImageUrl="~/images/widget/icon_close_16x16_a.png" Visible="true"    />
                <HeaderCloseVerb ImageUrl="~/images/widget/icon_close_16x16_a.png"  />
                
                 
            </CCZ:DropDownCatalogZone>
     </td>
     </tr>
     </table>
      
     
     </td>
    </tr>
    <!--End Catalog-->
    
     <!--Top Zone-->
     <tr>
     <td  align ="center"   >
     
 <%--  <asp:UpdateProgress ID="MainProgress" runat="server"  AssociatedUpdatePanelID="MainUpdatePanel" >
        <ProgressTemplate   >
        
          <asp:Image ID="Image1" runat="server"  ImageUrl ="~/images/circling-squares-with-trail.gif"  AlternateText="Updating">
                                                                                          </asp:Image>
              Processing........
        
        </ProgressTemplate>
        </asp:UpdateProgress>--%>
     
     
     <table width="950px" Id="topZone" border="0" >
     <tr>
     <td align=center>
     
     
       <CustomiseWebpart:TemplatedWebPartZone ChromeTemplateFile="~/Chrome_templates/WebPartTemplate2.chrome" 
        HeaderText="Top Zone"  Width="950px" 
        WebPartVerbRenderMode="TitleBar" LayoutOrientation="Vertical"  ID="TopZone" runat="server"
        HeaderStyle-BorderWidth="0px" HeaderStyle-BorderColor="White">
        
         
            <ZoneTemplate>
              
            </ZoneTemplate>
            <PartTitleStyle BorderWidth="0px" BorderColor="White"   />
            <PartStyle BorderWidth="0px" BorderColor="White"   />
           
         <CloseVerb ImageUrl="~/images/widget/icon_close_16x16_a.png" />                                                                                                            
         <MinimizeVerb ImageUrl="~/images/flat_minimize.gif"  Visible="true"  Enabled="true"    />                                                                                                            
         <RestoreVerb ImageUrl="~/images/flat_restore.gif" Visible="true"  Enabled ="true" />
         <EditVerb Visible ="false" />
         <DeleteVerb Visible ="false" /> 
        </CustomiseWebpart:TemplatedWebPartZone>
        
     </td>
     </tr>
     </table>
     
     
     </td>
    </tr>
     
      <!--End TopZone-->
      
      
      <!--Main Body-->
     <tr>
     <td>
     <table border="0"  width="950px" Id="MainBody">
     <tr>
     <td>
        <table  border="0"  width="950px" cellspacing="0" border="0" align="center"  height="100%">
                    <tbody>
                        <tr>
                            <td  valign="top" >
                            
                            
        <CustomiseWebpart:TemplatedWebPartZone ChromeTemplateFile="~/Chrome_templates/WebPartTemplate.chrome"
        HeaderText="Left Zone" Width="315px"  
        WebPartVerbRenderMode="TitleBar" LayoutOrientation="Vertical" ID="LeftZone" runat="server"
        HeaderStyle-BorderWidth="0px" HeaderStyle-BorderColor="White"  
         
        >
        
         
            <ZoneTemplate>
              
            </ZoneTemplate>
            <PartTitleStyle BorderWidth="0px" BorderColor="White"   />
            <PartStyle BorderWidth="0px" BorderColor="White"   />
           
         <CloseVerb ImageUrl="~/images/widget/icon_close_16x16_a.png" />                                                                                                            
         <MinimizeVerb ImageUrl="~/images/flat_minimize.gif"  Visible="true"  Enabled="true"    />                                                                                                            
         <RestoreVerb ImageUrl="~/images/flat_restore.gif" Visible="true"  Enabled ="true" />
         <EditVerb Visible ="false" />
         <DeleteVerb Visible ="false" /> 
        </CustomiseWebpart:TemplatedWebPartZone>
                            
                            
                            
                            
                               
                                 
                            
                            </td>
                            <td>&nbsp;</td>
                            <td  valign="top">
                            
                            
                            
                            
                            
                            
                             <CustomiseWebpart:TemplatedWebPartZone ChromeTemplateFile="~/Chrome_templates/WebPartTemplate.chrome" 
        WebPartVerbRenderMode="TitleBar" LayoutOrientation="Vertical" ID="MiddleZone" runat="server"
        HeaderStyle-BorderWidth="0px" HeaderStyle-BorderColor="White"  Width="315px" 
        HeaderText="Middle Zone"
         
        >
        
         
            <ZoneTemplate>
              
            </ZoneTemplate>
            <PartTitleStyle BorderWidth="0px" BorderColor="White"   />
            <PartStyle BorderWidth="0px" BorderColor="White"   />
           
         <CloseVerb ImageUrl="~/images/widget/icon_close_16x16_a.png" />                                                                                                            
         <MinimizeVerb ImageUrl="~/images/flat_minimize.gif"  Visible="true"  Enabled="true"    />                                                                                                            
         <RestoreVerb ImageUrl="~/images/flat_restore.gif" Visible="true"  Enabled ="true" />
         <EditVerb Visible ="false" />
         <DeleteVerb Visible ="false" /> 
        </CustomiseWebpart:TemplatedWebPartZone>
                            
       
        </td>
        <td>&nbsp;</td>
        <td valign="top" >
        
                            
                            
        <CustomiseWebpart:TemplatedWebPartZone ChromeTemplateFile="~/Chrome_templates/WebPartTemplate.chrome" 
        WebPartVerbRenderMode="TitleBar" LayoutOrientation="Vertical" ID="RightZone" runat="server"
        HeaderStyle-BorderWidth="0px" HeaderStyle-BorderColor="White"  HeaderText="Right Zone" Width="315px">
        
         
            <ZoneTemplate>
              
            </ZoneTemplate>
            <PartTitleStyle BorderWidth="0px" BorderColor="White"   />
            <PartStyle BorderWidth="0px" BorderColor="White"   />
         <%--   <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False"  Height="25px" />
           --%>
         <CloseVerb ImageUrl="~/images/widget/icon_close_16x16_a.png" />                                                                                                            
         <MinimizeVerb ImageUrl="~/images/flat_minimize.gif"  Visible="true"  Enabled="true"    />                                                                                                            
         <RestoreVerb ImageUrl="~/images/flat_restore.gif" Visible="true"  Enabled ="true" />
         <EditVerb Visible ="false" />
         <DeleteVerb Visible ="false" /> 
        </CustomiseWebpart:TemplatedWebPartZone>
                            
                        
                                
                                
                              
                             
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                    </tbody>
                </table>  
     
     
     
     </td>
     </tr>
     </table>
     
     
     </td>
    </tr>
     
      <!--End Main Body-->
      
      
      
       
      
     <!--Footer -->
    
    <tr>
    <td style ="background-color:#e1e1e1"  >
    <table width="950px" id="Footer" border="0"  >
    <tr style ="background-color:#e1e1e1">
    <td  align="right" >
    <asp:Image ImageUrl="~/Images/logo_pipe_view_footer.png"  runat ="server" ID="ImgFooter"   />
    </td>
    </tr>
    </table>
    
    </td>
    </tr>
    
      <!--End Footer-->
    
    </table>
</ContentTemplate>
</asp:UpdatePanel>
      </div>
 
    </form>
</body>
 
<script type="text/javascript"> 
   Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function (sender, args)
    { 
        if (args.get_error() && args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException')
         { 
            //alert('Caught a timeout!');
            // remember to set errorHandled = true to keep from getting a popup from the AJAX library itself 
            args.set_errorHandled(true);
        } 
        if (args.get_error() && args.get_error().name === 'sys.webforms.PageRequestManagerParserErrorException')
         { 
            //alert('Caught a timeout!');
            // remember to set errorHandled = true to keep from getting a popup from the AJAX library itself 
            args.set_errorHandled(true);
        } 
         if (args.get_error() && args.get_error().name === 'sys.webforms.PageRequestManagerServerErrorException')
         { 
            //alert('Caught a timeout!');
            // remember to set errorHandled = true to keep from getting a popup from the AJAX library itself 
            args.set_errorHandled(true);
        } 
   }); 
</script>
</html>
 
 
.cs (code behind page ):
 
 
#region   NameSpaces Declaration
 
using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Drawing;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Infragistics.WebUI.UltraWebGrid;
using Infragistics.WebUI.UltraWebGrid.ExcelExport;
using System.Reflection;
using PLMDataAccess;
using InfoSoftGlobal;
using Bewise.Web.UI.WebControls;
 
using System.Text;
 
#endregion
 
public partial class Dashboard_TestPage : System.Web.UI.Page, IWebPart
 
{
 
    #region Variable Declaration
    SqlConnection sqlConnection1;
    private string strRegion = string.Empty;
    string sessionId = string.Empty;
    string[] groups = null;
    string[] appContext = null;
    string[] configs = null;
    string[] cases = null;
 
    PLMDataAccess.PLMDataAccess m_pda = new PLMDataAccess.PLMDataAccess();
    #endregion
 
    #region "Region of IWebPart Interface properties"
 
    public string catalogIconImageUrl, description, subtitle, titleIconImageUrl, titleUrl;
    public string title = "Energy Solutions";
 
    [Personalizable]
    string IWebPart.Title
    {
        get
        {
            return title;
        }
        set
        {
            title = value;
        }
    }
    [Personalizable]
    string IWebPart.CatalogIconImageUrl
    {
        get
        {
            return catalogIconImageUrl;
        }
        set
        {
            catalogIconImageUrl = value;
        }
    }
    [Personalizable]
    string IWebPart.Description
    {
        get
        {
            return description;
        }
        set
        {
            description = value;
        }
    }
    [Personalizable]
    string IWebPart.Subtitle
    {
        get
        {
            return subtitle;
        }
    }
    [Personalizable]
    string IWebPart.TitleIconImageUrl
    {
        get
        {
            return titleIconImageUrl;
        }
        set
        {
            titleIconImageUrl = value;
        }
    }
    [Personalizable]
    string IWebPart.TitleUrl
    {
        get
        {
            return titleUrl;
        }
        set
        {
            titleUrl = value;
        }
    }
 
   
 
    #endregion "Region of IWebPart interface properties"
    protected void Page_Load(object sender, EventArgs e)
    {
 
 
        try
        {
            
            sessionId = Session["SessionId"].ToString();
            groups = m_pda.GetGroups(sessionId);
            appContext = m_pda.GetAppContextsForGroup(sessionId, groups[0]);
            configs = m_pda.GetConfigs(sessionId, groups[0], appContext[5]);
            cases = m_pda.GetCases(sessionId, groups[0], appContext[5], configs[1]);
                    
       
 
            HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
            if (authCookie == null)
            {
                string MyCookieName = "Reminder";
                System.Web.HttpCookie MyCookie = Request.Cookies[MyCookieName];
                string UserId;
                if (Request.Cookies[MyCookieName] == null)
                {
                    UserId = System.Guid.NewGuid().ToString().Replace("-", "");
                    MyCookie = new System.Web.HttpCookie(MyCookieName, UserId);
                    MyCookie.Expires = DateTime.Now.AddYears(1);
                    Response.Cookies.Add(MyCookie);
                }
                else
                {
                    UserId = MyCookie.Value;
                }
                FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, UserId, DateTime.Now, DateTime.Now.AddSeconds(60), false, "roles");
                string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
                authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);
                Response.Cookies.Add(authCookie);
                Response.Redirect(Request.Url.ToString());
            }
        }
        //}
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
        finally
        {
 
        }
 
        Timer1.Interval = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["TimeInterval"]);
 
        if (!IsPostBack)
        {
 
            wpManager.DisplayMode = WebPartManager.DesignDisplayMode;
           
            PopulateRegionsCombo();
            LeftZone.BorderStyle = BorderStyle.None;
            MiddleZone.BorderStyle = BorderStyle.None;
            RightZone.BorderStyle = BorderStyle.None;
            TopZone.BorderStyle = BorderStyle.None;
         }
 
 
        //if (HttpContext.Current.Session["Region"] == null)
        //{
        //    HttpContext.Current.Session["Region"] = "D_Full";
        //}
        if (cmbRegions.SelectedIndex != -1)
        {
            HttpContext.Current.Session["Region"] = cmbRegions.SelectedItem.Text;
        }
 
        //if (HttpContext.Current.Session["Region"].Equals("SELECT PIPELINE REGION"))
        //{
        //    HttpContext.Current.Session["Region"] = "D_Full";
        //}
 
        //}
     
        
    }
 
    protected void Page_PreRender(Object sender, EventArgs e)
    {
        
        
 
    }
 
    #region "Region of Webcombo methods"
 
    protected void cmbRegions_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            strRegion = cmbRegions.SelectedItem.Text;
 
            if (HttpContext.Current.Session["Region"] == null || HttpContext.Current.Session["Region"].ToString().Equals((string.Empty)))
            {
                cmbRegions.SelectedIndex = 0;
            }
            else
            {
                cmbRegions.SelectedIndex = cmbRegions.Items.IndexOf(cmbRegions.Items.FindByText(HttpContext.Current.Session["Region"].ToString()));
            }
 
 
            //if (cmbRegions.SelectedItem.Text.Equals("SELECT PIPELINE REGION") )
            //{
            //    HttpContext.Current.Session["Region"] = "D_Full";
            //   // cmbRegions.SelectedIndex = 1;
            //}
            //else
            //{
 
            HttpContext.Current.Session["Region"] = cmbRegions.SelectedItem.Text;
            //  }
 
 
 
 
        }
        catch (Exception ex)
        {
            string str = ex.Message.ToString();
        }
 
 
    }
    private void PopulateRegionsCombo()
    {
        try
        {
            // cmbRegions.Items.Clear();
            string[] astrRegions = m_pda.GetInstanceIDsForObjectType(sessionId, groups[0], appContext[5],
                configs[1], cases[0], "SYS.Region");
 
            if (astrRegions != null)
            {
                //              cmbRegions.DataSource = astrRegions;
                //                cmbRegions.DataBind();
                for (int i = 0; i < astrRegions.Length; i++)
                {
                    cmbRegions.Items.Add(new ListItem(astrRegions[i].ToString(), i.ToString()));
 
                }
 
 
 
                if (HttpContext.Current.Session["Region"] == null || HttpContext.Current.Session["Region"].ToString().Equals((string.Empty)))
                {
                    cmbRegions.SelectedIndex = 0;
                }
                else
                {
                    cmbRegions.SelectedIndex = cmbRegions.Items.IndexOf(cmbRegions.Items.FindByText(HttpContext.Current.Session["Region"].ToString()));
 
                }
                //if (HydraulicProfiles != null)
                //{
 
                //    ((GenericWebPart)HydraulicProfiles.Parent).Title = "Hydraulic Profiles - " + cmbRegions.SelectedItem.Text;
                //}
                //if (LinePackChart != null)
                //{
 
                //    ((GenericWebPart)LinePackChart.Parent).Title = "Line Pack Forecast - " + cmbRegions.SelectedItem.Text;
                //}
                //if (PressureProfileChart != null)
                //{
                //    ((GenericWebPart)PressureProfileChart.Parent).Title = "Pressure Profile - " + cmbRegions.SelectedItem.Text;
                //}
 
                //if (FlowProfileChart != null)
                //{
                //    ((GenericWebPart)FlowProfileChart.Parent).Title = "Flow Profile - " + cmbRegions.SelectedItem.Text;
                //}
 
                //if (Trend1 != null)
                //{
                //    ((GenericWebPart)Trend1.Parent).Title = "Trend - " + cmbRegions.SelectedItem.Text;
                //}
 
 
                HttpContext.Current.Session["Region"] = "D_Full";//cmbRegions.SelectedItem.Text.ToString();
                //HttpContext.Current.Session.Add("Region", strRegion);                
            }
 
 
 
        }
        catch (Exception ex)
        {
 
            string str = ex.ToString();
        }
    }
 
    #endregion "Region of Webcombo methods"
 
    protected void btnCustomize_Click(object sender, EventArgs e)
    {
        wpManager.DisplayMode = WebPartManager.CatalogDisplayMode;
        
 
    }
    protected void OnWebpart_Closed(object sender, WebPartEventArgs e)
    {
        wpManager.DeleteWebPart(e.WebPart);
 
    }
 
    //protected void lnkHelp_click(object sender, EventArgs e)
    //{
    //    string jScript = "<script language='JavaScript'>" +
    //    "Alert('suresh');"+
    //     //"var Left = (screen.width/2)-100;" +
    //     //"var Top = (screen.height/2)- 100;" +
    //     //"window.open('../Help.aspx',null,'height=100,width=250,status=no,toolbar=no,menubar=no,location=no,top='+Top+',left='+Left);" +
 
    //     "</script>";
 
    //    //ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenWindowScript", javaScript, false);
 
    //    ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), jScript, true  );
    //}
 
}
[+][-]07.08.2008 at 10:33PM PDT, ID: 21960815

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 10:47PM PDT, ID: 21960861

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 10:56PM PDT, ID: 21960896

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, JavaScript, Asynchronous Javascript and XML (AJAX)
Tags: asp.net 3.5, ajax
Sign Up Now!
Solution Provided By: GoofyDawg
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.28.2008 at 07:48AM PDT, ID: 22591285

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 02:26PM PDT, ID: 22628869

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628