How Can I Make Right To Left Navbar In My Webform? - c#

I'm just recently start Asp.net And now I'm gonna to make right to left navbar.
Try some code but all was left to right.

in case you using bootstrap use : class="navbar-right"
in case you didn't use it you should better use it )
but if you still didn't want to you can use dir="rtl" in your nav header tag or creating class and use it like that
<!DOCTYPE html>
<html>
<head>
<style>
.rtl {
direction: rtl;
}
</style>
</head>
<body>
<Navbar class="rtl">your text
...
</Navbar>
</body>
</html>

Related

How to show multiple HTML contents in a single page in ASP.Net?

Suppose I'm opening email details in a ASP.Net .aspx page div control. The problem is when I'm opening an email details containing html tag the page is showing messed up. Only the inner html contents are showing on the page. Is there any way I could solve this problem.
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<form >
<!-- Outer HTML contents... -->
<div id="dvViewMailReadOnly" style="overflow:auto; width:100%;height:auto;">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<img src="http://click.email.skype...>
</body>
</html>
</div>
</form>
</body>
</html>
The email contents are showing on dvViewMailReadOnly dynamically.
I'm still not sure I understand the problem. Yes, the HTML is invalid, as there must only be one <html> element (and consequently also only one <head> and <body> element).
If you are allowed to modify your form, then you could simply do this:
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<form >
<!-- Outer HTML contents... -->
<div id="dvViewMailReadOnly" style="overflow:auto; width:100%;height:auto;">
<img src="http://click.email.skype...">
</div>
</form>
</body>
</html>
Replace < by < and > by >

jquery simple code not working(id is assigned to the button)

This is the sample code that i am learning from w3schools. This time i have given the id too to the button. Please help.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("button").click(function () {
$("#div1").fadeIn();
$("#div2").fadeIn("slower");
$("#div3").fadeIn(3000);
});
});
</script>
<title></title>
</head>
<body>
<h2>Try jQuery</h2>
<br /><button>Click me</button>
<br /><br />
<div id="div1" style="width:80px;height:80px;color:green"></div>
<div id="div2" style="width:80px;height:80px;color:yellow"></div>
<div id="div3" style="width:80px;height:80px;color:blanchedalmond"></div>
</body>
</html>
$("#hide").click(function () ...
this line of code basically means "when an element with id 'hide' is clicked, do something". So your button is missing that id
<button id="hide">Click me</button>
Just copy and paste it. It works. Tested.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!--<script type="text/javascript" src="jquery-1.11.2.js"></script>-->
<script>
$(document).ready(function () {
$("#hide").click(function () {
$("p").hide();
});
});
</script>
<title></title>
</head>
<body>
<h2>Try jQuery</h2>
<p>This will get hide</p>
<button id="hide">CLick Me</button>
</body>
</html>
As others have mentioned your script is looking for something with the ID attribute 'hide' as indicated in your jQuery $('#hide').
There are many different ways to select everything in your dom. Have a look at the jquery documentation. http://api.jquery.com/category/selectors/ The simplicity of selecting dom elements is what makes jQuery so powerful in my opinion.
Select by ID:
$('#id')
You can select every even row in a table.
$('table tr:even')
You can select the 14th div element in the dom.
$('div:eq(14)')
You can select all elements with a given class.
$('.class')
Here is a JSfiddle with the code in a working fashion.
http://jsfiddle.net/5v94cnrr/
It looks like the button is ID 'hide' and it will hide all P elements on click. Typically you'd use a class called hide and hide all element with class hide on click of the button or some other action.
You have not set #hide for anything. If you need it on a button, do:
<button id="hide">CLick Me</button>
You want to hide p tag elements on onclick of button.
So firstly, you have to provide id for this button because you are making click function on button.
Try this:
<button id='hide'>Click Me</button>

Unable to dispaly markers on map using mapbox ,leaflet Omnivore

I am trying to use CSV file to display markers on map using mapbox and leaflet. I found one example in mapbox documentation , I am trying to use the same example , I just changed the CSV file but it is not displaying markers on map. I just started using map box so desperately looking for some help.
my CSV file looks like this
Value,FacTy,Latitude,Longitude
1,112,42.27426,-83.365717
2,113,42.274082,-83.3623
3,30,42.337196,-83.487672
Here is my code snippest
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Loading markers from CSV</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.2.0/leaflet-omnivore.min.js'></script>
<div id='map'></div>
<script>
var map = L.mapbox.map('map', 'examples.map-i86nkdio')
.setView([42.274082, -83.362300], 8);
omnivore.csv('latlon.csv',null,L.mapbox.featureLayer()).addTo(map);
</script>
</body>
</html>
Looks like you're missing a linebreak before the first row of your data. Here's a fixed example.
Value,FacTy,Latitude,Longitude 1,112,42.27426,-83.365717
2,113,42.274082,-83.3623
3,30,42.337196,-83.487672
should be
Value,FacTy,Latitude,Longitude
1,112,42.27426,-83.365717
2,113,42.274082,-83.3623
3,30,42.337196,-83.487672
I was having the same issue as you, and then realized that it was a problem with the data. In order to log those errors on the console, you have to use:
omnivore.csv('your_file.csv', null, L.mapbox.featureLayer()).addTo(map)
.on('error', function(error) {
console.log(error);
});
And it will tell you which line is not working, such as an invalid lat or long. More info.
Hope this helps!

C# web scraping Javascript

Suppose my website has source code:
<!DOCTYPE html>
<html>
<head>
<title>Wow</title>
</head>
<body>
<div id="hello">
</div>
<script type="text/javascript">
function simple()
{
$("#hello").append("<p>Hello</p>");
}
</script>
</body>
</html>
I want a C#/asp.Net method to extract it's source code as follows:
<!DOCTYPE html>
<html>
<head>
<title>Wow</title>
</head>
<body>
<div id="hello">
</div>
<p>Hello</p>
</body>
</html>
string src=new WebClient().DownloadString("http://mywebsite.com")
doesn't help as it extracts the raw html code along with the javascript, same as the source code.
From looking at the comments above I understand that you're looking for the scripts to be executed before you get the final HTML DOM.
What you need is a JavaScript engine to run the scripts, the basic mechanics of a browser.
Depending on your needs, you can either implement this yourself with V8 (Chrome's JavaScript engine) or SpiderMonkey (Mozilla's JavaScript engine) or use one of the two popular headless browser frameworks: PhantomJS and CasperJS. Using them will also cover all your future AJAX needs should you have any.

DateTimepicker in Asp.net

I want to show date and time picker. I googled many times but not getting anything. I download the files from the "keduoi.com" and used in mu project but its not working properly showing only textfield. I am trying from this link.
Here is code:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="LaterTime_Pick_up.aspx.cs" Inherits="LocationBasedTaxiServices.LaterTime_Pick_up" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="styles/kendo.common.min.css" rel="stylesheet" />
<link href="styles/kendo.default.min.css" rel="stylesheet" />
<script type="" src="js/jquery.min.js"></script>
</head>
<body>
<div id="example" class="k-content">
<div id="to-do">
<input id="datetimepicker" style="width:200px;" />
</div>
<script type="">
$(document).ready(function () {
// create DateTimePicker from input HTML element
$("#datetimepicker").kendoDateTimePicker({
value: new Date()
});
});
</script>
<style scoped>
#to-do {
height: 52px;
width: 221px;
margin: 30px auto;
padding: 91px 0 0 188px;
background: url('../../content/web/datepicker/todo.png') transparent no-repeat 0 0;
}
</style>
</div>
</body>
</html>
It's showing only textfield.
I am not sure unless you can tell exactly what error you are getting. But if you have not added js file then go ahead and do it first.
There are different plans available to get kendo ui. Refer This
There is documentation by kendo for using datepicker in asp.net application.
Link Here
You must include the Javascript for kendoui.
<script src='xxxx/kendo-uixxx.js'></script>
kendo.all.min.js is missing in your code.
You also can use jQuery.UI, it sometimes easier for beginners to start building client interfaces with jQuery.
jQuery UI: http://jqueryui.com/
jQuery UI Datepicker: http://jqueryui.com/datepicker/

Categories

Resources