C# - Overlaying Html Content On Top Of Silverlight App?
Jan 8, 2010
I have a silverlight application that I am embedding in an existing ASP.NET web application. The web application has several drop-down navigation menus that would normally cover part of the silverlight app. I am aware of embedding the app using "windowless" mode, and if I do so the HTML menus show up on top of the silverlight plugin and everything looks great.
The problem is that I do not want to run in windowless mode due to its limitations. The application needs to handle MouseWheel events, which are not available natively in windowless mode. I am also not happy with the performance drawbacks of running in windowless mode. If I set windowless mode to false, the silverlight plugin is always rendered on top of the navigation menus which drop down behind it.
Is there any kind of CSS/JavaScript/Z-Index hackery that can be done to force certain divs of HTML on my page to render on top of the silverlight app WITHOUT running in windowless mode? I don't have high hopes as I understand this scenario is one of the main reasons for running in windowless mode.
We have an app template we've created in asp.net 2.0 that we use for our web apps. It has a header that hosts a couple controls (like a drop down for customer selection) and a language dropdown. It has a footer that's pretty static. In the middle is the content portion of the masterpage. Talk has come up as to whether we can make the content piece in SL4? I'm not sure how the two pieces (apps) would communicate - like for the customer selection changed. Has anyone done anything like this?
When I create a default silverlight application in VS2010, I get a silverlight user control and a web site that hosts it. The object tag in the apsx page that hosts the silverlight object has its width and height set to 100%. The silverlight user control takes up all the broswer window and it also grows and shrinks properly as the browser is resized. Perfect.
If I add a master page and child page, in the child page I copy the object tag, still set at 100% height, the rendered page does not expand to fill the browser window/ I can set the object tag height to, say, 600, and it now is static at 600, but I want it to be dynamic just like when it was not hosted on a master page.
I do not believe this to be a silverlight issue, but rather a content placeholder sizing issue. I have tried a lot of diffferent ways to set the height, but nothing I do allows me to make the child page hosted object size itself based on the browser window,
Is it possile to get this to work or is this a consequence of using master pages? I can post sample code demonstrating this if needed.
EDIT: I was able to use a javascript function on window.onload to get the browser height and set the div height that contains the object tag, this works but is not dynamic. I would like it to be dynamic like the non-master page hosted object is.
When Bing map control loads for first time on any browser all pushpin on map are visible.
Bing map control renders perfectly.
Then I refresh browser it create rendering issue some custom pushpin on map gets disappeared. This behavior continues with pushpin. Pushpin are (.png) images and I am not using default bing map thumbtacks.
May be it is issue of browser caching content or Bing map control rendering issues on various browsers.
I will be getting data through wcf service coming form commerce server (instead of DB). Data which is coming will be in the form big html content with all html tags or may be a single line sentence. I should display this dynamic data into the placeholder in the content page (master content page). I have been trying but not able to load when the data is in the form of HTML page. html content or may be single lline of senetence.
I'm getting this message when going to a web app that accesses my service.
"The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8)..."
The thing is, it happens once in a while even when no changes have been made to the service or the web app. And I can make it go away most of the time by going directly to the .svc?wsdl page in my browser and then coming back to the web app.
Which Control i can use to view HTML Content which is i saved in db with its Text Format Like Color,Font Size , Font Name .... so which control i can use to view that Formatted HTML Content
I have a AJAX editor and I want to put the HTML content in a database and I want to get the HTML data from the database to put in the HTML editor, in HTML mode.
I was reading the ASP.NET MVC Best Practices article by Rashid, and got stuck in his description of creating UrlHelper extensions. Doing this is easy enough, and I've adopted the practice into all of my projects. I noticed, however, that Rashid used Url.Content to generate the url for the home page, and Url.RouteUrl for all the other urls. Why is this? What is the difference between the two?
The link to the blog post is here: http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx
I've used Html.ActionLink in my Views, but I'm wondering what difference it would be if I used Url.RouteUrl instead. Does anyone have a good grasp of what makes these helpers different, and where they are best used?
<A HREF="/files/1234/mybook.b1">mybook.b1</A><br>11/24/2010 1:02 AM 991
I want to fetch only the date element from this string. i.e 11/24/2010 1:02 AM
I know i can do that using the substring method of string class but i need to implement a standard solution for this problem. i.e. fetch date from any html content if it contains a date element.
Regex r = new Regex(this.textbox1.Text); Match m = r.Match(this.SearchStringTextBox.Text); while (m.Success) { Response.Write(m.Value); Response.Write("<br>"); m = m.NextMatch(); } this.textbox1.Text="<img[^>]* src="([^"]*)"[^>]*>" this.SearchStringTextBox.Text = " I get html content ..........."
I am writing an application that renders a list of "Job" objects from an AJAX JSON response.
What is the best way to Render the markup from the returned data. Now I'm pretty convinced that its a bad idea to generate HTML markup on the server side and return that from the AJAX call. From experience it makes the HTML hard to maintain and re factoring the content is a nightmare, so I am returning a collection of Job objects as JSON.
The question, then, is how to render the HTML based on user input? I've seen some examples of having your markup template on the page then use JQuery to clone it and populate with the relevant data the insert it into the DOM.
The problem with this is that the template contains visible content (images and suchlike) and the application needs to degrade, so I have a repeater on the page that the severside code and populate on page load if JS is not available.
There are lots of questions on how to strip html tags, but not many on functions/methods to close them.
Here's the situation. I have a 500 character Message summary ( which includes html tags ), but I only want the first 100 characters. Problem is if I truncate the message, it could be in the middle of an html tag... which messes up stuff.
Assuming the html is something like this:
<div class="bd">"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <br/> <br/>Some Dates: April 30 - May 2, 2010 <br/> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <em>Duis aute irure dolor in reprehenderit</em> in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. <br/> </p> For more information about Lorem Ipsum doemdloe, visit: <br/> <a href="http://www.somesite.com" title="Some Conference">Some text link</a><br/> </div>
How would I take the first ~100 characters or so? ( Although, ideally that would be the first approximately 100 characters of "CONTENT" ( in between the html tags )
I'm assuming the best way to do this would be a recursive algorithm that keeps track of the html tags and appends any tags that would be truncated, but that may not be the best approach.
My first thoughts are using recursion to count nested tags, and when we reach 100 characters, look for the next "<" and then use recursion to write the closing html tags needed from there.
The reason for doing this is to make a short summary of existing articles without requiring the user to go back and provide summaries for all the articles. I want to keep the html formatting, if possible.
NOTE: ignore that the html isn't totally semantic. This is what I have to deal with from my WYSIWYG.
EDIT:
I added a potential solution ( that seems to work ) I figure others will run into this problem as well. I'm not sure it's the best... and it's probably not totally robust ( in fact, I know it isn't ),
I have a website where I'm trying to use an HTMLEditor to allow users to alter the body of email text. The text is stored in a database and looks like this:
[Code]....
I load the current email body into the Content property of a new HTMLEditor.Editor object. When it loads the HTML, though, it looks like it does above; it doesn't "process" it. Can the Editor process the HTML?
Also, when I do edit HTML in the object and submit, the Editor's Content includes "<" instead of "<", etc. Do I have to manually deal with that?
I have an ASP.NET content page. The HTML tag associated with the content page is declared in the master page. I need to add an attribute to the HTML tag from the content page. My problem is, I do not know how to access this HTML tag from the content page.
What I'm trying to do is use one master page with two different layouts. Currently we have a "master" master page that has all the common elements and two master pages that use it for the two different layouts. This gives us 3 master pages and there's developer confustion and it is a bit of a hassle to keep them consistent. What I'd like to do instead is say "if there's anything in the MainContent ContentPlaceHolder, show the single column layout, otherwise show the two column layout".
From what I've read you're supposed to be able to do this by using something like the following:
[Code]....
But this.MainContent.Controls.Count retuns zero when the ContentPlaceHolder uses Html.RenderPartial. For example, this works fine:
[Code]....
This causes this.MainContent.Controls.Count to return 1. If I remove MainContent from the view, it returns 0, as expected. However, if I do this:
[Code]....
Then this.MainContent.Controls.Count returns zero.