I want to allow numbers only to be allowed for a textbox and I already do it onkeydown event by allow only numbers and prevent ctrl+V but I have two problems :
if I make right click then paste so any char can be entered and I want a solution without disable right click by oncontextmenu="return false;"
if I drag and drop any text it will be entered
Is there any solution that can work in all browsers without problem ?
I would like to display links that are pasted in as links rather than text but freetextbox does not seem to do this. For instance, if somebody pastes in http://www.stackoverflow.com it looks like a link but shows up only as text. Do I need to convert this myself or is there a setting in the editor to take care of this?
hi,
I developed a webapplication,Now i want to create Rss feeds for my website.
In my application i have a module call Film news, which contain the latest news of the film stars. Now i want to create rss feeds for that module. the news contains title and description. Can you help me how can i create rss feeds for my application. Tahnks in advance.
I know that in community server which means that you can't use Sessions, and few years ago i remember i was working on a website where we were not allowed to use sessions.
In my point of view sessions are a very helpful tool if we managed how to use the right way, but is using session variable in a website is something bad, when its bad and when its not?
I have an HTML file on my server, and a Javascript file on the same server. I want it so that when I load the HTML file, it will the reference of .js file placed on the server.
I tried this way:
<html>
<head>
<script type="text/javascript src="...server side path...."></script>
</head>
</html>
but it is not working. Can any one tell me how I can do this?
Hi All,
I am using the following code to show confirmation dialog box after finishing some update process in database. but it is not working for me.
code:
string javaScript = "<script language=JavaScript>\n " + "if(confirm('Do you want to update
the files?'))window.location.href = \"Upload.aspx?ID=" + ID +
"&pt=Gm&page=Gms\"; else return false;\n" + "</script>";
RegisterStartupScript("imbtnUpdate_Click", javaScript);
I'm working for a website where i need to sum functionality related to sales
I'm very new to the website stuff and found many things on net but don't knew what to follow.
Can anybody suggest me some good tutorials which i can follow to create my website
The things which i am going to work on as:
saving customer information to data base
using saved customer information, placing order
generating bills and invoices and downloading it in pdf file format
sending mails to customer with those invoice as attachments
I need to check on disabling JavaScript if the user disabled JavaScript from browser or firewall or any other place he will never show the form.
I have lots of search and solutions, but unfortunately didn't got the right one.
- Using style with no-script tag: This one could be broke with removing style...
<noscript>
<style type="text/css">
.HideClass {
display:none;
}
</style>
</noscript>
The past code will work just fine but there is lots of problems in no-script tag as here
Beside that i don't want to redirect user with no-script tag too...Beside that i can quickly stop loading the page to broke this meta or disable Meta tag from IE:
<meta http-equiv="refresh" content="0; URL=Frm_JavaScriptDisable.aspx" />
Another way to redirect user with JavaScript but this will work let's say for 99% of users and this one isn't lovely way and will slow down the website...
window.location="http://www.location.com/page.aspx";
Is there is any other ideas or suggestions to secure working with JavaScript...and prevent user from entering the website or see my form except when JavaScript enabled...
Here is my situation:
Page1.aspx redirects to Page2.aspx which does some processing (does not display to the user) and then redirects to Page3.aspx which checks the ServerVariables["HTTP_REFERER"] or Request.UrlReferrer.
I understand that the referring information can sometimes be blank and can't be entirely relied upon; however the ServerVariables["HTTP_REFERER"] or Request.UrlReferrer on Page3.aspx is showing Page1.aspx instead of Page2.aspx which I would have expected.
Does the referring information only get set if the page displays to the user?
Redirecting is done using Response.Redirect in order to change the URL in the address bar of the browser.
Sorry for the long title, I didn't know how to make it any shorter.
My code:
My model:
public class CarFilter {
public String carMake { get; set; }
public String carModel { get; set; }
public String carEdition { get; set; }
.
.
.
public String SortBy { get; set; }
}
public class CarSearch : CarFilter {
public List<Car> Car { get; set; }
}
My controller:
public ActionResult SearchResult(CarSearch search)
{
var cars = from d in db.Cars
select d;
if (Request.HttpMethod == "POST")
{
search.SortBy = "Price";
}
search.Car = new List<Car>();
search.Car.AddRange(cars);
var temp = new List<CarSearch>();
temp.Add(search);
return View(temp);
}
My Index view (where user filters results):
@model IEnumerable<Cars.Models.CarSearch>
@using (Html.BeginForm("SearchResult", "Home", FormMethod.Post)){..forms and other stuff..}
My SearchResult view (where user sees the results of filtration):
@model IEnumerable<Cars.Models.CarSearch>
@using (Html.BeginForm("SearchResult", "Home", FormMethod.Get))
{
@Html.Hidden("carMake")
@Html.Hidden("carModel")
@Html.Hidden("carEdition")
.
.
.
@Html.Hidden("SortBy", temp.SortBy)
<input name="SortBy" class="buttons" type="submit" value="Make"/>
My goal
What I'm trying to do is when user clicked on sort by Make it will have to GET back all the variables in hidden field back to the SearchResult action in order to sort the result (same filtered results).
Result
Is: <input id="SortBy" name="SortBy" type="hidden" value=""/>. The value is null and it's not being passed but all the other hidden fields such as carMake and etc have value. But when I use foreach it works perfect.
Question
Why is this like this? the SortBy is in the same model class as other fields in the view. The only difference is that SortBy is not being filled in the Index view with other fields, instead it's being filled in controller action. What is the explanation for this? Am I missing any C# definition or something such as dynamic objects or something?
The project I'm currently working has a whole bunch of JSON actions in order to populate cascading dropdowns via ajax calls. Since they're technically Select queries and we're trying to be RESTful, we've been marking these actions with the HttpGet attributes. However by default, JsonResultdoes not allow to return results via a GET. So we've had to explicitly call Json(data, JsonRequestBehavior.AllowGet).
What I'm wondering is, is this bad practice? Should we only be allowing Post requests to our Json actions? If it makes a difference, this is an enterprise application, that requires a log in to a particular environment before it can be accessed.
I have an MVC3 application in Visual Studio 2010.
I have a view with several dropdowns that do javascript calls to populate dropdowns based on the selected value, some of which are disabled initially.
That all works great with the initial state of nothing. If I however pass routevalues to the dropdowns from a redirect to this action, I do get the value set correctly but it's not enabled like it should be on the dropdown for example and when I post the form, the ones that are greyed out are not passed back on the form.
How can I correct this?
I am using an iframe to show the child pages.In that one one particular page contains hidden div and i am showing it as a pop-up like thing with javascript by changing the visibility of the hidden div.
Problem is before showing the hidden div , some manipulations are done at server level and I am calling the div from C# code after the manipulations like
Page.ClientScript.RegisterStartupScript(GetType(), "MyKey", "javascript:OpenModelPopup('cb','cs');", true);
so the page is getting posted back and the div is shown.
after this, after going to next page if i click browser back it shows that page with that hidden div and on next click of browser back gives the page without hidden div.
but I want to show only the initial stage of the page ie. without showing the hidden div
that stage with hidden div should not be cached or it should not be shown on click of browser back.
I have a view: User. In that I have an ascx page : Details
I have a view : Test. I want to access the Details from User from test, using render partial. How can I do that?
<%Html.RenderPartial("Details"); %> doesn`t workin this case.
Hi,
I have the following code:
string path = "~/Others/Muzica/Demo/"+interpret+"_"+album+"/";
CMSUtils.CreateFolder(MapPath(path));
where CreateFolder method is like:
public static void CreateFolder(string path)
{
if (!System.IO.Directory.Exists(path))
{
System.IO.Directory.CreateDirectory(path);
}
}
So i create that folder if it does not exists...
All works great locally BUT i do not understand why, if i put it on the server it gives:
Failed to map the path '/gramma_prod/Others/Muzica/Demo/Vitamina C_De n-ai fi fost Tu /'.
at CMSUtils.CreateFolder(MapPath(path));
I have checked if: /gramma_prod/Others/Muzica/Demo/ exists on the server and of course it exists...
Does anybody see the problem?
I'm using a list of siteMapProviders in my web.config file.
To retrieve these values in code, I need to specify the names in strings.
Understandably, these is always a mismatch at runtime.
Is there a way to return a strongly typed enum vlaues of these?
I have an Admin folder which contains 4-5 aspx pages. I want to that only user with role="admin" can view those files. What settings i need in web.config?
do you got the solution for your problem ?
im working on the exact same thing and cant get it to work...
if u could post the solution, it would be much appreciated :o
greetingz
msn: [email protected]
steam : [email protected]