asp.net updatepanel - updatepanel

I have update panel in Modal popup extender, and I have script manager in masterpage, but when I run the website, I get following error :
[InvalidOperationException: The control with ID 'udpOutterUpdatePanel' requires a S
criptManager on the page. The ScriptManager must appear before any controls that need it.]
System.Web.UI.UpdatePanel.get_ScriptManager() +303
System.Web.UI.UpdatePanel.RegisterPanel() +170
System.Web.UI.UpdatePanel.RegisterPanel() +132
System.Web.UI.UpdatePanel.OnInit(EventArgs e) +53
System.Web.UI.Control.InitRecursive(Control namingContainer) +605
System.Web.UI.Control.InitRecursive(Control namingContainer) +323
System.Web.UI.Control.InitRecursive(Control namingContainer) +323
System.Web.UI.Control.InitRecursive(Control namingContainer) +323
System.Web.UI.Control.InitRecursive(Control namingContainer) +323
System.Web.UI.Control.InitRecursive(Control namingContainer) +323
System.Web.UI.Control.InitRecursive(Control namingContainer) +323
System.Web.UI.Control.InitRecursive(Control namingContainer) +323
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2241
When I add scriptmanager in my page it gives error as "Only one instance is allowed".
Please help me out of this.
I am using windows 7,vs2010
Thanks in advance...

Are you sure your "Modal popup extender" is linked to the master page with "ContentPlaceHolderID" which contains the "ScriptManager" from the maste page ? so that it can load the "ScriptManager" !
<%# ... MasterPageFile="~/MasterFile.master" .... %>
<asp:Content ID="myContent" ContentPlaceHolderID="ContentScriptManager" Runat="Server">
</asp:Content>

You can also add ScriptManagerProxy in content page, which enables nested components such as content pages to add script to pages when a ScriptManager control is already defined in a parent element.

Related

loading dynamic photo using ASP.net with IMAGE.ImageUrl

I am using asp.net for a website and i am using nested master page.
i want to load dynamic a picture from the nested master page.
the html code in the nested master page is:
<a runat="server">
<asp:Image id="usrimg" src="" alt="Image Not Found" runat="server" />
</a>
the C# code is:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
var u = Session["user"] as Worker;
String s = "/images/" + u.UserName + ".jpg";
usrimg.ImageUrl = s;
}
}
note that the path is correct( i debug the code behind)
but always the source in the inspect is unknown.
this is the result :
<img id="userphoto_ContentPlaceHolder1_usrimg" src="" alt="Image Not Found">
i solve it by using :
usrimg.Attributes["src"] = s;

Adding Support for Multiple Language to a Web Page?

I know I could do this by simply copying the files over, changing the names (adding a language code like "about" versus "about_es", or "contact" versus "contact_es") and basically redirecting them to a different site altogether, but I was wondering how to go about doing this like the Elder Scrolls website does it (URL is the same). It seems like that method would be more elegant/professional.
Any ideas?
you can create resource JSON or XML file
ex1:
<languages>
<language id="EN">
<element name="page_head" >Hello world</element>
<element name="page_footer" >goodbye world</element>
</language>
<language id="FR">
<element name="page_head">Bonjour tous le monde</element>
<element name="page_footer">Heureux voir tous le monde</element>
</language>
</languages>
ex2:
a=[{
"language":"EN",
"elements":
{
"page_head":"Hello world",
"page_footer":"goodbye world"
}
},
{
"language":"EN",
"elements":
{
"page_head":"Bonjour tous le monde",
"page_footer":"Heureux voir tous le monde"
}];
or maybe you can just use a lazy way aka "databases"!

Difficult with LineChart

I need help about LineChart:
Situation:
I have a LineChart with some data acquired by Oracle query, I have in select the columns ValorC, ValorP, Sla and OBS, where OBS="Justification if some problem occurred in ValorC". The problem is How can I show this value when put mouse over the point (value) in chart ? I can work with DataTip?
<mx:series>
<mx:LineSeries id="IDValor" displayName="Execução Diária" yField="ValorC" showDataEffect="seriesInterpolate" />
<mx:LineSeries id="IDValorP" displayName="Meta Produção" yField="ValorP" showDataEffect="seriesInterpolate" />
<mx:LineSeries id="IDSLA" displayName="Sla Acordado" yField="Sla" showDataEffect="seriesInterpolate"/>
</mx:series>
I resolved the problem with two funcions:
- 1º
public function init():void { chart.addEventListener(ChartItemEvent.ITEM_ROLL_OVER, minhaSolicitacao); }
- 2 º
public function minhaSolicitacao(e:ChartItemEvent):void { TextObs.text = e.hitData.item.OBS; }
*OBS are visible=false TKS for ALL

Hide SSRS parameters in CRM 2011

I describe my problem differently,
I could open the report with the following code
var url="/"+orgname+"/crmreports/viewer/viewer.aspx?action=run&helpID=OppClients.rdl&id=%7bC7D34446-7F90-E111-A8F3-080027EA7FF9%7d&p:nomclient=aziza boulabyar";
window.open(url, "", "height=" + (screen.availHeight * .75)
+ ",width=" + (screen.availWidth * .75)
+ ",toolbar=no,menubar=no,scrollbars=no,resizable=yes,location=0");
Now I want to hide the parameter in the reports and when I added &rc:parameters=false to the url I get an error as described in the picture below
Can some one tell me how to solve this problem
Below the contents of the log File:
at ErrorInformation.LogError()
at ErrorInformation..ctor(Exception exception, Uri requestUrl, Boolean logError)
at MainApplication.Application_Error(Object sender, EventArgs eventArguments)
at EventHandler.Invoke(Object sender, EventArgs e)
at HttpApplication.RaiseOnError()
at ApplicationStepManager.ResumeSteps(Exception error)
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
>MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Une exception de type 'System.Web.HttpUnhandledException' a été levée.
Error Message: CRM Parameter Filter - Invalid parameter 'rc:parameters=false' in Request.QueryString on page /Manhattan/crmreports/viewer/viewer.aspx
The raw request was 'GET /Manhattan/crmreports/viewer/viewer.aspx?action=run&helpID=OppClients.rdl&id=%7bC7D34446-7F90-E111-A8F3-080027EA7FF9%7d&rc:parameters=false&p:nomclient=aziza%20boulabyar' called from .
Error Details: Une exception de type 'System.Web.HttpUnhandledException' a été levée.
Source File: Not available
Line Number: Not available
Request URL: http://localhost:5555/Manhattan/crmreports/viewer/viewer.aspx?action=run&helpID=OppClients.rdl&id=%7bC7D34446-7F90-E111-A8F3-080027EA7FF9%7d&rc:parameters=false&p:nomclient=aziza%20boulabyar
Stack Trace Info: [InvalidOperationException: CRM Parameter Filter - Invalid parameter 'rc:parameters=false' in Request.QueryString on page /Manhattan/crmreports/viewer/viewer.aspx
The raw request was 'GET /Manhattan/crmreports/viewer/viewer.aspx?action=run&helpID=OppClients.rdl&id=%7bC7D34446-7F90-E111-A8F3-080027EA7FF9%7d&rc:parameters=false&p:nomclient=aziza%20boulabyar' called from .]
à Microsoft.Crm.Application.ParameterFilter.ValidateParameter(HttpRequest request, ArrayList parameterCollection, String key, String value, ParameterSources source, EntityType pageEntityType, FormAdditionalAllowedParameters additionalAllowedParameters)
à Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType, Boolean alwaysEnableParameterChecking, FormAdditionalAllowedParameters formAdditionalAllowedParametersTemp)
à Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType, Boolean alwaysEnableParameterChecking)
à Microsoft.Crm.Application.Controls.AppPage.ValidatePageParameters()
à Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
à System.Web.UI.Control.InitRecursive(Control namingContainer)
à System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException: Une exception de type 'System.Web.HttpUnhandledException' a été levée.]
à System.Web.UI.Page.HandleError(Exception e)
à System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
à System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
à System.Web.UI.Page.ProcessRequest()
à System.Web.UI.Page.ProcessRequest(HttpContext context)
à System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
à System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
My solution involves several steps, mostly unsupported - but it works.
Clone the existing C:\Program Files\Microsoft Dynamics CRM\CRMWeb\CRMReports\viewer\viewer.aspx to .\viewerNoToolbar.aspx
Update in viewerNoToolbar.aspx the following code to remove the Toolbar from SSRS :-
function reportLoaded()
{
if (oFrame.readyState === "complete")
{
addToRecent();
}
to
function reportLoaded()
{
if (oFrame.readyState === "complete")
{
addToRecent();
var frameDoc = oFrame.contentDocument || oFrame.contentWindow.document;
var reportViewerToolbar = frameDoc.getElementById("reportViewer_Toolbar");
reportViewerToolbar.style.display = "none";
}
Insert a DIV to hide the existing CRM toolbar and move the existing resultFrame IFrame out of the DIV
</div>
<table cellspacing="0" cellpadding="0" width="100%" height="100%">
to
</div>
<div style="display: none">
<table cellspacing="0" cellpadding="0" width="100%" height="100%">
also close it off by changing the below from
</table>
</body>
to (and remove the existing td block related to resultFrame)
</table>
</div>
<table cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr style="height: 100%;">
<td colspan="2" style="padding-top: 5px; padding-bottom: 10px; border-width: 2px;
border-color: #000000">
<div id="divResultFrame">
<iframe name="resultFrame" id="resultFrame" src="/_static/blank.htm" style="border: 0px;
margin: 0px; padding: 0px; width: 100%; height: 100%;"></iframe>
</div>
</td>
</tr>
</table>
</body>
Change your query to
var url="/"+orgname+"/crmreports/viewer/viewerNoToolBar.aspx?
and don't worry about rc:Toolbar
Good luck
Glenn
According to this article Pass parameters and options with a URL in SQL Reporting Services you did right.
But when I tried to do the same I've got this error wich tells absolutely nothing.
To see what's going on I would recommend you to use tracing, see this post CrmDiagTool 2011, this tool will make using it much easier.
My guess is that you need to make those parameters optional somehow.
Sorry, don't have time to dive into it.
If you don't solve it in a couple days let me know we'll work it out.

link anchors in HTML email

I am trying to make a newsletter email with an idnex that has links to different anchors in the mail, but so far, it doesn't seem to work in any client. This is the code:
<ul style="list-style: none; margin: 0px; padding: 0px; ">
<li>Sehen wir uns auf der ISH?</li>
<li>Sehen wir uns auf der ISH?</li>
<li>Sehen wir uns auf der ISH?</li>
<li>Sehen wir uns auf der ISH?</li>
<li>Sehen wir uns auf der ISH?</li>
</ul>
...
<a name="anchor1" id="anchor1">foo</a>
What?s even weirder, in GMAIL my ID tag disappears and my name tag gets some sort of weird prefix, like "124335132_anchor1". What could I do?
you know how usually you have the string
<div id="boom">...
and you want to anchor link to that from somewhere else, you would enter
so now you would use a name tag in addition to your destination.
<a name="boom"></a><div id="boom">...
Viola! anchor link in html email.
Email clients aren't web browsers or designed to be. They leave off vast swathes of things you are likely to consider "pretty basic".
Make all links absolute and plan for them to open in a web browser.
To work with outlook 2010, it has to be like that:
Jump to section!
<p>A bunch of content</p>
<a name="section1">An anchor!</a>
not sure i'm getting what you mean.. but, it looks like you wanted to send MIMEBody as an email content, so the email looks like an html format.. if it the case, here is some piece from my java code:
#Override
public void coba() {
try {
MimeMessage message = new MimeMessage(mailSession);
message.setSubject("Whatever");
message.setRecipient(RecipientType.TO, new InternetAddress("SomeEmail#email.com", "SomeName Name"));
//
// This HTML mail have to 2 part, the BODY and the embedded image
//
MimeMultipart multipart = new MimeMultipart("related");
// first part (the html)
BodyPart messageBodyPart = new MimeBodyPart();
String htmlText = "<div style=\"width:800px; background-color:#525252\"><h1>Header</h1></div><br /><div style=\"width:200px; background-color:#ff0000; float: left\"><h3>Navigation Panel</h3><ul><li>link here</li><li>link here</li></ul></div><div style=\"width:600px; background-color:#727272; float: left\"><h3>Content</h3><p>blabla blabla blabla blabla blabla</p><br /><img src=\"cid:image\" /></div>";
messageBodyPart.setContent(htmlText, "text/html");
// add it
multipart.addBodyPart(messageBodyPart);
// second part (the image)
messageBodyPart = new MimeBodyPart();
DataSource fds = new FileDataSource("C:/img/lion.JPG");
messageBodyPart.setDataHandler(new DataHandler(fds));
messageBodyPart.setHeader("Content-ID","<image>");
// add it
multipart.addBodyPart(messageBodyPart);
// put everything together
message.setContent(multipart);
Transport.send(message);
//System.out.println("Successfully Send Email(" + subject + ") to " + emailAddress);
} catch(Exception e) {
e.printStackTrace();
}
}
i send an email with html format, here is screen shot the message content on gmail
here is the screen shot
hopefully it have any use for you..