Showing posts with label facing. Show all posts
Showing posts with label facing. Show all posts

Monday, March 26, 2012

Print Problem With Updatepanel

HI,

Iam facing problem with update panel.I has a reportviewer and a updatepanel.Updatepanel consists of Reportviewer.Whenever i click on Print Option of Reportviewer,Postback ocurs But no print dialog appears.(So no print).How to Print report when it is is in updatepanel.

When i remove updatepanel Print wrks .But when i keep it in updatepanel NO PRINT ocurs

Plz help ...It is Very urgent

With regards,

Mahender

Any chance you can post the code?
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;

Saturday, March 24, 2012

Problem during Uploading the file

Hi

The Problem that am facing is

1)The path of the file that is saving in the database is "Path of the Server" + "images/"Up" of the path variable. I dont know why.

2) When i click on the Save Button, the code says File Uploaded but the file is missing from the location. Actually i think that "SaveAs" function is not working properly.

Boolean fileOK = false;
String path = Server.MapPath("/images/Uploads/employee/images/");
if (!(Directory.Exists(path)))
{
Directory.CreateDirectory(path);
}
lblInformation.Visible = true;
if (fuplEmployeeImage.HasFile)
{
String fileExtension = System.IO.Path.GetExtension(fuplEmployeeImage.FileName).ToLower();
String[] allowedExtensions = { ".gif", ".png", ".jpeg", ".jpg" };
for (int i = 0; i < allowedExtensions.Length; i++)
{
if (fileExtension == allowedExtensions[i])
{
fileOK = true;
}
}

if (fileOK)
{
if (File.Exists(path + fuplEmployeeImage.FileName))
{
lblInformation.Text = fuplEmployeeImage.FileName + " already Exists.Please Rename the file and try again.";
}
else
{
try
{
fuplEmployeeImage.PostedFile.SaveAs(path + fuplEmployeeImage.FileName);
_prEmployee.Attachment = path + fuplEmployeeImage.FileName;
lblInformation.Text = fuplEmployeeImage.FileName + " File Uploaded!";
}
catch (Exception ex)
{
lblInformation.Text = fuplEmployeeImage.FileName + " File could not be Uploaded.";
}
}
}
else
{
lblInformation.Text = "Cannot accept files of this type.";
}
}

Any help is greatly appreciated.

Thanx

If you're using AJAX with the FileUpload control, it's never going to work. See this thread for more details:

http://forums.asp.net/t/1107788.aspx


Hi

Thanx for your response.

I know this thing that File Upload Control doesn't work inside Update Panel of AJAX.For that purpose i had fire PostBacktrigger for thec control which actually calls FileUpload Control.

So that is not an issue

Bye


Hi,deepakleo2003

I'd like to give you a demo:

<%@. Page Language="C#" %>
<%@. Import Namespace="System.IO" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

protected void Button1_Click(object sender, EventArgs e)
{
Boolean fileOK = false;
String path = Server.MapPath("images/");
if (!(Directory.Exists(path)))
{
Directory.CreateDirectory(path);
}
lblInformation.Visible = true;
if (fuplEmployeeImage.HasFile)
{
String fileExtension = System.IO.Path.GetExtension(fuplEmployeeImage.FileName).ToLower();
String[] allowedExtensions = { ".gif", ".jpg", ".png", ".jpeg" };
for (int i = 0; i < allowedExtensions.Length; i++)
{
if (fileExtension == allowedExtensions[i])
{
fileOK = true;
break;
}
}

if (fileOK)
{
if (File.Exists(path + fuplEmployeeImage.FileName))
{
lblInformation.Text = fuplEmployeeImage.FileName + " already Exists.Please Rename the file and try again.";
}
else
{
try
{
fuplEmployeeImage.PostedFile.SaveAs(path + fuplEmployeeImage.FileName);
//_prEmployee.Attachment = path + fuplEmployeeImage.FileName;
lblInformation.Text = fuplEmployeeImage.FileName + " File Uploaded!";
}
catch
{
lblInformation.Text = fuplEmployeeImage.FileName + " File could not be Uploaded.";
}
}
}
else
{
lblInformation.Text = "Cannot accept files of this type.";
}
}
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblInformation" Visible="false" runat="server" Text="lblInformation"></asp:Label>
<asp:FileUpload ID="fuplEmployeeImage" runat="server" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
</form>
</body>
</html>

If this help you,don't forget mark it as a answer.Thanks!

Let me know if you need more info.

problem in ajax website

hi

i am facing a problem in creating Ajax website.

When i am takingAjax enabled website option i am able to do everything fine.

But when i am taking a create Website option i am getting error . I have also includedScriptManager on the page which is required by most of the Ajax Controls to work properly.

Thanx in advance

Hi.

When you create an Ajax-enabled web site, the WEB.Config file created contains config section, HTTP handlers, HTTP modules all needed by AJAX.

One example is that the ScriptManager creates a call for javascript called ScriptResources.axd where axd is not known extension for your web-server
(unlike ASPX, ASMX, JS, ASHX etc.) The httpHandler section includes this extension and set it to be handled by AJAX extension (System.Web.Extensions.DLL file)

What you should do (especially when adding AJAX capability to an existing site) is to copy these additions to your web.config file from an "AJAX-Enabled"
web site. Then you won't e having these errors.


Problem in calling a Webservice in ATLAS Application.

Hi Every body im new to this community,

Im facing problem in calling the webservice from ATLAS Application .

If the WEbservice is in the same solution im able to do it, but when i create a new webservice and try to call in my ATLAS application im not able to do it,

Im getting following Error "

<atlas:ScriptManagerID="NamSpacescriptManager"EnableScriptComponents="false"runat="server">

<Services>

<atlas:ServiceReferencePath="SimpleService.asmx"/>

<atlas:ServiceReference

Path=http://localhost:3505/SimpleCalculator/SimpleCalculator.asmx/>

</Services>

</atlas:ScriptManager>

<scripttype="text/javascript"language="javascript">

function OnAddServiceClick( )

{

var response = SimpleCalculator.Add(3,3,Oncomplete,OnTimeOut,OnError);

returnfalse;

}

</script>

Im getting Error : SimpleCalculator , undefined, can i know what is wrong ...

Regards,

Hi,

The problem is that, a service reference to a web service causes an xmlscript reference in the generated page through a "/js" call to the web service.

If you examineCalling a simple Web Service from an ASPX page quick start sample, when you add
<atlas:ServiceReference Path="SimpleService.asmx" />
to your source, what is rendered as xmlscript is:
<references>
<add src="http://pics.10026.com/?src=SimpleService.asmx/js" />
</references>

Call SimpleService.asmx/js and you will get this piece of javascript:
Type.registerNamespace('Quickstart.Samples'); Quickstart.Samples.SimpleService = new function() { this.path = "http://atlas.asp.net/quickstart/atlas/samples/services/SimpleService.asmx"; var cm=Web.Net.ServiceMethodRequest.createProxyMethod; cm(this,"EchoString","s"); }

So, behind the scenes, Atlas client framework makes a call to the web service, asks the service to describe itself in javascipt and registers a function for you to call later from your code.

But there's no such default "/js" handler in web service world. Instead, Atlas provides necessary handlers in web.config to reply requests for "webservicename.asmx/js". That's why it works when your web service is in the same project with your Atlas GUI project.

If you enable the Atlas handler for .asmx files in your web service project as in your GUI project, it should work fine.

Wednesday, March 21, 2012

Problem in invoking Webservice in ATLAS.Application

Hi Everybody,

Im facing problem in calling Webservice in ASP.NET ATLAS Page.Im trying to invoke a Webservice which is external to my system , in my application as follows:

<atlas:ScriptManagerID="NamSpacescriptManager"EnableScriptComponents="false"runat="server">

<Services>

<atlas:ServiceReferencePath="SimpleService.asmx"/>

<atlas:ServiceReferencePath="http://www.xmlwebservices.cc/ws/v1/calc/SimpleCalc.asmx"/>

</Services>

</atlas:ScriptManager>

function OnAddServiceClick( )

{

var response = SimpleCalc.Add(3,3,Oncomplete,OnTimeOut,OnError);

returnfalse;

}

in this above case, I went thru the WSDL and found the name of Class as SimpleCalc hence was trying to invoke the method ADD , May i know what is wrong in this ,

Or is it ATLAS doesnt support mechanism to invoke a webservice other than local system.

I would also like to know internally how ATLAS is invoking the Webservices, ie, Proxy classes ., how is it done .,

Thanks & Regards

Lohita

It looks like you might have neglected to instantiate the web proxy object in your Javascript, as in the following manner:

var calcSvc = new SimpleCalc();

var request = calcSvc.Add(...);


Is that something new? Because in the February CTP, I was just calling WebMethods like ..
var request = SimpleCalc.Add(...) and it was working fine. I'm about to try instantiating it now, but
I'm wondering again, if that's new .. or if something stranger is going on.

No, this has not changed, and you don't need to instantiate it.

Calling cross domain services is tricky, as it runs into browser security limitations. If the other server is also running Atlas, the March release has some support to make it work. If not, you should look into the new bridge feature (see Atlas docs and samples for details).

thanks,
David


I was actually wrong in my previous post. Your problem here is that you cannot make a web service call to a domain other than that which your page comes from. In order to do this, you must "bridge" the call through your web server using the new Bridge functionality added to the March CTP.

Hi David,

What do you mean by "If the other server is also running Atlas.." Does it mean the external webservice which we call using bridge feature should also have Microsoft.Web.Atlas.dll in its bin directory?

Thx, Vishant


No, I was referring to the ability to call services on a different server directly from the client. The bridge feature always goes through your Atlas server, and has no restrictions on what other servers it can bridge to.

David

Problem of Validation Controls With AJAX Panel.

Hi All,

I am facing a problem when using validators inside AJAX update panel. The scenario is that i have some requiredFieldValidators inside AJAX Update Panel. When partial post back occours then validators do not show error message, its another things that page also not submites.

Can any one help me in this regard.
Thanks.

acording to me, AJAX and asp.net validation controls doent go well with each other. You try using ajax validation control


Disable the the client side scripts of those validators, otherwise checkout this threadhttp://forums.asp.net/t/1066821.aspx