Web Forms :: How To Block Ads In A Browser
May 7, 2015Is there any possiblilties where we can use to block the unwanted ads in a browser using asp.net??
View 1 RepliesIs there any possiblilties where we can use to block the unwanted ads in a browser using asp.net??
View 1 RepliesI strucked with one problem in C#.net coding part, my problem is "how to block the videos in website on IE browser" through the C# coding. actually i am developed one toolbar for IE browser so in that toolbar i added one button for block the videos,so when i click in that toolbar button that time in IE browser website videos are blocking
View 6 RepliesI have menu item on my master page that has block around the text when the page is first run. I wrote in the css on the link and visited property to change the color to match the image color that it is on. When a menu item is clicked the color changes to the right color. How do I get it to the right color on when the page first opens or is there a way to get rid of the block or make it transperant?
View 1 RepliesI have 2 separate code-block asp.Net expressions in an aspx markup, with an html content between (span element in the example below). In the first code-block, there is "i" as an increment variable for the for loop.Then the code-block is cut with an html content.And another code-block expression is opened but as I see I can reach the "i" variable which was declared in the previous code-block.
So, how asp.net handles -compiles- the pieces of code-block experrions declared in the mark up? Does it check the semi-colons and generates some anonymous methods which will end up with many calls to Response.Write in the last place?
<p>
<%for (int i = 0; i < 30; i++)
{
[code]....
I used javascript code to open popup window.Popup window "Maximize" button is in
disable state.But in Chrome it is in enable state.I want to make browser maximize button disable.
Below is my javascript code
function Call_PopUp(event, URL) {
window.open(URL, 'CustomPopUp', 'width=990, height=540, menubar=no,scrollbars =yes, resizable=no, top=50,left=50,toolbar=no,dialog=yes,minimizable=yes,maximizable=no');
}
i need to get the Browser version, type of the user. i need the short name not the long one.
at the monent i have this:
browser = Request.ServerVariables("HTTP_USER_AGENT") that retuens this:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249
i need only (Chrome/4.1.249), (MSIE 8.0)...............
plus i would like to get the operating system too
I have a web application that runs via IIS 7 what i want to do with the application (Asp.net with C#) is only load if the browser is greater than IE9, or greater than or equal to Chrome27 or greater than or equal to firefox19.
How to do this or areas i should read to do such a thing?
I'm new to ASP.net 3.5 and creating a test web site. I have created a master page for my web site with page content blocks. Now I want to use some javascript on the client side to provide for more interaction. I would normally create page specific Javascript functions and insert them in a <script block on the page. Howevere the Javascript script block must be placed before the <HTLM block. If I'm using Master Pages, it doesn't seem that I can use page specific Javascript functions. How can I resolve this problem? I think my options are
1) Don't use Javascript. Use ? instead to write client-side code.
2) Don't use Master Pages because you cannot use Page Specific Javascript functions.
3) Here's how to insert Javascript Functions in a Page with a Master Page.
I have a table in a div which starts as invisible and by clicking a link it should be shown. The tables are in my aspx files while the div(s) are in the masterPage. This works just fine in FF but most of the time they do not show up in IE. If I manuallydo a refresh first then most of the time the div is shown.
<div id="drag" style="z-index: 5" >
<div>
<div>
script language="javascript" type="text/javascript">
var theSubject = '<%=Session["subject"]%>';
[code]...
When to write try catch block?
Should I write it for each method or only in event handlers or ????
What happens when an exception occurrs? What is the stack for exception?
If I use it at entry point (event handlers) then how do I get actually at which line error occurred?
Suppose an exception was thrown from Data Access Layer How do I get it in presentation layer that exactly in which class method at which line why that error occurred?
Is it true that excessive use of try catch makes application slow?
Can somebody show me a better approach of looping through a Try -Catch statement. I have something like this:
Try
dbConn.Open()
Catch ex As Exception
errmsg = ex.Message
End Try
I need to try to connect 5 times before logging an error. My first thought was to nest Try - Catch 5 levels but I didn't like that idea. I'm sure there is better solution to it.
When add elements, like text or other controls inside a big <div> block, they are alwasy on the top.
Ex. <div style="height:50px;">this is a test</div>
Does anyone know how to use CSS to position them in the middle of it? I tried using CSS vertical-align, no luck.
Is there a way to disable input into a textbox at the same time allow cursor focus?
View 3 RepliesSince everyone yells at me that MessageBox doesn't work when the project is uploaded to the server, I need to migrate to javascript alert box. As I was changing my MessageBoxes, I tested and found that they weren't being produced. I'm not sure if it matters, but they are in a try/catch block, which is shown here:[Code]....
This all worked before when I had MessageBox - it showed, then the page redirected when I clicked Ok.
I either don't understand how try/catch works, the javascript isn't adding, or Response.Redirect is executed before I can see the alert box and click Ok on it.
(just as a note, everything works fine, but the alert box doesn't show)........if I add the (javascript) code before the try block, the alert box comes up, so it's not something wrong with the writing of the javascript or executing it at least (I think).
How do I setup a fix length to block an arrow image 'GIF' from wrapping around the search field as the page gets smaller?
The test site is located at http://cforedu.com
The snippet code reads:
<input type="image" src="images/images/p.gif" alt="Submit" width="15" height="10px" align="top"/>
I'm kinda new to vb.net web forms and I'm trying to figure out the best way to create a dynamic employment history block on a web form. You know, the block where you list who you worked for, salary, dates etc.
On the form now I have three employment history blocks inside a table. If the person filling out the form has more employment history, I'd like to have a "add history" button that when clicked adds another employment block to the table. The user can click it as many times as they want to add more employment history blocks. I'd rather not reinvent the wheel here, so if someone has a sample of this and would be willing to share, or can point me to vb.net sample on the web that does this, I would appreciate it much.
l Im downloading Pdfs using WebClient I used below code
try {
WebClient wc = new WebClient();
Uri uriadd = new Uri(@"ftp://xxx.yyy..../httpdocs/FH/Foldername/" + clientorder1[i].Cloi_id + ".pdf");
wc.Credentials = new NetworkCredential("xxxx", "zzzz");
}
Its working fine but some times Gives Error like Object synchronization method was called from an unsynchronized block of code.. Why this Error coming ....
Can I have some codes in login attempts. For example, the user tried to login for three consecutive times and then he failed. The session he gets will be locked for about 30 seconds.
View 1 RepliesI'm reading an invoice dataset and building a html table with checkboxes and textboxes in it, and I put that code in a postback = false block, then i got a button and a literal. The button click will loop through the html table checkboxes to calculate a total and assign it to the literal and display it. I got everything working except one thing, every time i click the button, the html table refreshes and lost all the value in textboxes....even though I put the html building block in the postback = false block,it seems like it still won't preserve the values in the textboxes once there's a button click...Anybody knows a solution to that? I want the textboxes keep what values are there.
Here is the code part:
[code]....
Im calling the new popup window from gridview like
[Code]....
In the AddTargetPopUP.aspx ,I have button Call "ADD".When i click the add button it'll insert datas into database.I want to reload the parent gridview after insert into the database and want to close the popup.
I have website home page which my client can view well on his blackberry mobile phone but I have link buttons on that page which redirect the users to other pages ..just Response.Redirect ............simple code.... but when he clicks on the link, it requests for enabling javascript..I do that but the home page just does a postback. Links are not working on cellphone........... on regular website they are working fine.
View 2 RepliesI configure IE8 to block cookies.
View 1 RepliesIs it possible to use return statement in try block?.How,What is the use of the statement.
View 5 RepliesHow can I have my website block access to IE6? Redirecting it to a custom error page.
View 3 Repliesi have users who can logon to my site. I don't use the asp.net provider (i have my own user storage) but do use forms authentication. No i want to block users from log on twice to my app. Now what is the simplest thing to accomplish this? I thought about an extra field in the database in the user record but is there something simpler? is there a sort of 'session' for the entire application where i can remember who is logged on (and which is not flushed at a random time)? maybe in the cache (but the cache is sometimes flushed) i've seen an example where a file with the username was written to disk (and removed when logged out)
EDIT:
Good question was: what do you mean with logon twice. I mean when a user logs on on another computer or when another person logs on with the same credentials