How to disable the browser scrollbar in a Silverlight application? - c#

In my Silverlight application I need to permanently disable the browser scroll bar. When I run the application the browser scroll bar is visible. So I need to disable this one.
Please let me know in which file we should do and the code for disabling the scroll bar.

u have to make your UserControle(root userControle) smaller that fit-up in to your browser that's way your browser scroll bar can disable.....
use silverlight navigation template

When using the default aspx-page to display the Silverlight application (the one generated by Visual Studio) usually no scroll bars should appear. But if that is the case that's the place where to look.
Sometimes the browser (especially the Internet Explorer) renders line breaks where there are none. So try to remove any line-breaks from the HTML-markup surrounding the <object>-element hosting the Silverlight application.
Example: Convert the following code
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
</object>
<iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
</div>
</form>
to the following code by removing all linebreaks (I added the ... to make the code more readable here, leave the original parameters there of course)
<form ...><div><object ...></object><iframe ...></iframe></div></form>
In my case that did solve the issue.

Related

selenium find elements found wrong location on explorer 11 in c#

c # I am preparing a selenium project. I made a cross browser on the project, but I'm having trouble with internet explorer 11. Locators working correctly in all other browsers also work incorrectly in the intertet explorer.
selenium 3,12
ie version 11.431.16299.00
https://drive.google.com/open?id=1QhEsm9cIVNVRi0c37_L3mRc17mbXgR1m
Locator I have used : By.CssSelector("a.login-button.primary-action");
HTML :
</nav>
<nav class="login-navigation active">
Teklif Al
<nav class="login-menu">
Giriş Yap
<nav class="login-menu-list">
Yönetici Girişi
Kullanıcı Girişi
</nav>
</nav>
</nav>
According to official selenium documentation:
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
The browser zoom level must be set to 100% so that the native mouse events can be set to the correct coordinates.
For Windows 10, you also need to set "Change the size of text, apps, and other items" to 100% in display settings.
Also in "Hovering Elements" section there is a warning:
When you attempt to hover over elements, and your physical mouse cursor is within the boundaries of the IE browser window, the hover will not work.
If you take into account these configurations, it will work.
Try this code :
Driver.FindElement(By.LinkText("Giriş Yap"));
Try this
By.CssSelector(".login-button");
or
By.CssSelector("html body nav.login-navigation.active nav.login-menu a.login-button.primary-action");

bootstrap menu is hiding main text

I'm going crazy with this. I got the twitter-bootstrap menu running in my c# code and it looks and works great. However, the menu is overwriting my text of the site I've built. It seems no matter what I do the body of the site appears under the menu.... I'm thinking it's a CSS issue because if I resize the page to mobile size the body is then placed under the menu.
I'm not even sure what code I should cut and paste...?
I've tried various or row, ... etc...
How do I get my body text to show below the menu vs. underneath it?
Thanks
I had this problem too, I had to do a padding in my _layout.cshtml. This solved it for me.
<body style="padding-top: 40px;">

Use submit button control in a child template in umbraco

I learned that in umbraco, we have to use a master template for a custom user control. I have a custom form and a submit button. I created a control that sends an email once the 'submit" button is pressed. the control basically gets all the fields like name, address. It works when I create a new template and insert the macro.
However when I try to use it with a master template, it does not work. The submit button refreshes the page but never goes to my c# part where it sends the mail
and if I do this
<form name="myform" target="_self" method="post" action="index">
it goes to the index page, but no email is sent.
But it works on a clean or new template. Is there a way to use custom control with master template in umbraco 4
EDIT -
This is how I am using macro
<form name="myform" target="_self" method="post" action="index">
<umbraco:Macro Alias="sendMail" runat="server"></umbraco:Macro>
</form>
Looking at the code it looks like you are missing the runat="server" attribute on the form tag.
<form name="myform" runat="server">
<umbraco:Macro Alias="sendMail" runat="server"></umbraco:Macro>
</form>
By using the runat=server attribute the form tag will be rendered with the correct attributes. Note you can only have one runat="server" form on a page.
There's some more information on this concept on W3Schools
I assume you are using ASP.NET WebForms. I have Umbraco sites in which I also use a Master Template and a Macro which contains a form. This should work normally.
What I notice is that you have set the "action" attribute which is ignored. Also the "method" attribute default value is "post" so you don't need to set both these properties.
An ASP.NET Webform is always posting to itself, so you can remove the "target" property here. I'm not sure that removing these "unwanted" attributes will solve your problem.
If not, are you using nested .NET Forms? That is throwing errors and strange behavior as well.

C# WebBrowser won't display embedded object

This may be a dumb question, but I just can't get it to work. I'm trying to embed a pdf file into a webbrower in a c# program. Simple right? I thought so, but it proved otherwise.
Here's the html code:
<object classid="" type="application/pdf" width="400" height="300" id="pdf1">
<param name="src" value="Test.pdf" />
<div style="text-align:center; color:#CCCCCC" >No Preview Available.</div>
</object>
And that's all thats in the html file. The funny thing is, this works perfectly in IE (which as I understand is what the WebBrowser uses). I've tried implementing the object tag the non-IE way, with an src attribute and whatnot, but it did the same thing. What's happening is the WebBrowser control is just displaying No Preview Available meaning that the pdf was not successfully embedded. Here's the c# code:
wbPreview.Navigate("I:/Documents/Visual Studio 2008/Projects
/PlanReferenceDatabase/test.html");
Can someone tell me why the web browser in c# cannot display the pdf, but the other browser can?
Try formatting the tag like this:
<object type="application/pdf" data="myPdfFile.pdf" class="yourPdfClass" width="550px" height="800px"/>
Include the data attribute in the tag and it seems to work just fine - just tried this in my browser control on a IE8 / IE9 machine and it displays inline.
I solved my problem. Just in case anyone else has the same one, here's what I did:
First I set the "target platform" property under the build tab in visual studio to x86 because as it turns out, 64bit IE can't render PDFs.
Second I used the embed tag instead of the object tag, because IE requires you to use "classid" and all sorts of Active X stuff you don't want when you use the object tag.

About modal pop control to the ajax control tool kit

First of all hi too member
now my 1st talk i had one ajax control tool kit tht doesnt work on the vs 2008
so please help me for tht and
other problem I had make one modal pop code for the site but it nt working properly
mean when I click on the button it will only display Loader image but it did nt display tht page or div tag which cover the whole page with black color
so i need that back ground color div tag
Some please help me
I am badly stuck with this problem
in advance thank you
If I have deciphered your post correctly, you can show the ModalDialog but it doesn't "color" the rest of the page, therefore making the popup non-Modal?
If this is the case, then you need set the BackgroundCssClass attribute of the ModalPopupExtender to a valid CSS class.
I normally use this...
.ModalBackground
{
background-color:Gray;
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="ModalBackground" [... the rest of the attributes....] />

Categories

Resources