vernal
Friday, January 15, 2010
CollapsiblePanelExtender basic animations
<%--
<cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server"
TargetControlID="Panel1"
CollapsedSize="0"
Collapsed="True"
AutoCollapse="False"
AutoExpand="False"
ScrollContents="True"
ExpandControlID="lblPanel1"
CollapseControlID="lblPanel1"
CollapsedText="Show Details..."
ImageControlID="imgDraft"
ExpandedText="Hide Details"
CollapsedImage="~/Images/collapse.gif"
ExpandedImage="~/Images/expand.gif"
ExpandDirection="Vertical"
/>
<cc1:AnimationExtender ID="AnimationPanel" runat="server" TargetControlID="lblPanel1" >
<Animations>
<OnClick>
<Sequence>
<EnableAction Enabled="false" />
<FadeOut AnimationTarget="Panel1"
Duration=".2" ></FadeOut>
<FadeIn AnimationTarget="Panel1"
Duration=".1" ></FadeIn>
<EnableAction Enabled="true" />
</Sequence>
</OnClick>
</Animations>
</cc1:AnimationExtender>
--%>
By using the AnimationTarget property of animation extender , i have associated only the panel to animate, so u do not have to give CollapsiblePanelExtender for the TargetControlID ,doing so will will trigger the animation whenever and where ever you click on the CollapsiblePanelExtender control
Thursday, January 14, 2010
Session loss using AJAX
So went to INETMGR and the properties of my default wesite , then to the tab documents.There i removed the non-important pages and added a single page. It worked for me , might for you, or probably its a specific case. But do give it a shot if u don't find the solution elsewhere.
TabContainer Animation on tab change
Solution = Found some good code for it , tweaked it as per the requirements. Here is it -
<%--
<cc1:TabContainer ID="TabContainer1" runat="server" EnableViewState ="true" OnClientActiveTabChanged = "ActiveTabChanged" >
<cc1:TabPanel ID = "panel1" HeaderText = "panel1" runat ="server" Enabled ="true" >
<ContentTemplate>
--Your Content
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID = "panel2" HeaderText = "panel2" runat ="server">
<ContentTemplate>
--Your Content
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID = "panel3" HeaderText = "panel3" runat ="server" Width = "500px" >
<ContentTemplate>
--Your Content
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
<script type="text/javascript">
function ActiveTabChanged(sender, e)
{
var Tab = $get('<%=TabContainer1.ClientID%>'); }
AnimateTab(Tab );
}
var HighlightAnimations = {};
function AnimateTab(el)
{
if (HighlightAnimations[el.uniqueID] == null)
{
HighlightAnimations[el.uniqueID] = AjaxControlToolkit.Animation.createAnimation({
AnimationName : "FadeOut",
duration : 0.5,
AnimationName : "FadeIn",
duration : 0.5
}, el);
}
HighlightAnimations[el.uniqueID].stop();
HighlightAnimations[el.uniqueID].play();
}
</script>
--%>
Tuesday, January 5, 2010
Cannot access a closed file - file upload asp.net
FIGHT -1 - The posted file from file upload control is removed as soon as the page is posted back.
SOLUTION - Save the posted file in a session as u press the upload document button you created, something like this -
protected void btnUploadDocument_Click(object sender, EventArgs e)
{
Session["UploadFile"] = FileUploadControl.PostedFile;
//pop up code
}
Then the confirmation pop-up props up. On selecting 'OK' cast the session as HttpPostedFile , something like this -
(HttpPostedFile)Session["UploadFile"]
Use this to upload the document.
FIGHT -2 - Error - Cannot access Closed File
SOLUTION- maxRequestLength, an attribute which governs the size of file being uploaded might have not been updated.
By default it is 4 mb. to increase it , < httpRuntime maxRequestLength="20000" /> within the
tag in the web.config (put the value as required)
The problem might still persist , the root lies in requestLengthDiskThreshold attribute
update the above mentioned tag to -
< httpRuntime maxRequestLength="20000" requestLengthDiskThreshold="9000"/ >
(For more info on the two attribures , go to - http://msdn.microsoft.com/en-us/library/e1f13641.aspx)
Tuesday, November 10, 2009
Unable to start debugging on the web server. The web server is not configured correctly (asp .net)
PROBLEM -
Site is deployed on QA server or production. One fine morning this error flashes on the site. The whole world comes down crashing at you. Now you try debugging it in your local machine but to no avail. The build is successful but it doesnt run giving a big dialog box with some blah blah error.
PROBABLE CAUSES AND SOLUTION-
1. IIS picks the .net framework version to run the application. If somehow frame work is installed prior to IIS , then IIS and framework linking is ruptured. You need to re-link them.
Solution - go to cmd prompt or VS command prompt ,copy and paste the following :
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i
This relinks the iis and framework ......& Bingo !! it will work
2. Some freaking updates are installed on your workstation - either Symantec Endpoint Protection or some Windows update. So when tou try to run the mentioned command u receive an error.
Solution - Uninstall the Updates and run the command again.
3. Some valuable information can be found on the link
http://geekswithblogs.net/TimH/archive/2006/05/29/80002.aspx where a lot of troubled souls are combating with the problem .You will definitely find a solution if the abovementioned solutions didnt help.
4. If none helps , reinstall the frameworks and IIS . Now install IIS first then the frameworks.
5. Still persisting ......... Just pray......
O' Lord Help Me!! :)
Concatenate values in multiple columns into a single cell (SQL server 2005 and Oracle)
There are many instanc es wherein one is required to club values from different columns and rows into a condensed 1-cell format. Lets take an example:
Table - Tab_Emp :
NAME EMPLOYEE_CODE DESIGNATION
Ron 1 E
Paul 2 S
Maria 3 M
Rosy 4 R
The intended result is :
UNIFIED_INFORMATION
Name : Ron Code:1 Designation:E Name : Paul Code:2 Designation:S Name : Maria Code:3 Designation:M Name : Rosy Code:4 Designation:R
In SQL server 2005, we can create a cursor which reads through the table Tab_Emp and does the job for you. i have created a user defined function to do the same :
CREATE FUNCTION [Unify_Records]
RETURNS VARCHAR(8000)
AS
BEGIN --1
DECLARE @name VARCHAR(100)
DECLARE @code VARCHAR(100)
DECLARE @desig VARCHAR(100)
DECLARE @oneCELL varchar(8000)
SET @oneCELL = ''
Declare UNIFY_CURSOR Cursor For
SELECT * FROM Tab_Emp
BEGIN --2
OPEN UNIFY_CURSOR;
FETCH NEXT FROM UNIFY_CURSOR INTO @name,@code,@desig
WHILE (@@FETCH_STATUS = 0)
BEGIN -- 3
SET @oneCELL = @oneCELL +'NAME: '+ @name+', Code: '+ @code +', Desig: '+ @desig +''
FETCH NEXT FROM UNIFY_CURSOR INTO @name,@code,@desig
END --3
END --2
CLOSE UNIFY_CURSOR
DEALLOCATE UNIFY_CURSOR
return @oneCELL
END --1
- For ORACLE , here is the generalised code :
SELECT [Column1],
SUBSTR(MAX(REPLACE(SYS_CONNECT_BY_PATH([Column2], '/'),'/','')),2) Concatenated_String
FROM (select A.*,
row_number() OVER (Partition by [Column1] order by [Column1]) ROW#
from [Table_Name] A where [Column1] = ‘Ron’
)
START WITH ROW#=1
CONNECT BY PRIOR [Column1]=[Column1] AND PRIOR row# = row# -1
GROUP BY [Column1]
Here all the values in [Column2] pertaining to [Column1] will be concatenated and the end result will be:
[Column1]
∑[Column2]