|
so tell me how could i design whole things. suppose i have a registration class what has so many properties like
Account information
----------------------
First Name
Surname
Company Name
Contact Number
Email :
Password
Confirm Password
Billing information
----------------------
Address1
Address2
Town/City
County/State
PostCode
Billing Country
i have one customer class which has many properties for account and billing information. now i want when i will save customer data by EF then account info will be saved in customer table and billing info will be saved in address table. so tell me how could i do this mapping when i am working with EF db first and code first.
please discuss with a sample code. thanks
|
|
|
|
|
As you see in this example [^]
You should have relation between address table and billing table like a foreign key relation with billing table where primary key of that foreign key is defined in address table.
|
|
|
|
|
I have an aspx content page that is related to a .master file, which of course has a Form tag. I believe that the Form is getting resubmitted when the user clicks on the "Enable Flash" button in the Flash popup.
This occurs in Google Chrome (and NOT in IE or Firefox).
My question is, how to allow this popup to be clicked, essentially, to bypass the form resubmission?
|
|
|
|
|
Probably by changing the code for the popup, which we can't see because you haven't shared it with us.
But if this is a new development, you should avoid Flash if at all possible. You have less than three years until Adobe kill it:
Adobe will finally kill Flash in 2020 - The Verge[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We are replacing our Flash but it's a massive project. Until then, I have to deal with it. The pop-up isn't my own (.NET code), it's called this way from the aspx:
<%@ Page Title="" Language="C#" MasterPageFile="~/App_Parts/Masters/Home/ParentFastTrack.master" AutoEventWireup="true" CodeFile="fastTrack.aspx.cs" Inherits="members_Home_fastTrack" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="Server">
<script type="text/javascript" src="https://cdn.whizz.com/whizz-flash.min.js"></script>
<script>
Shadowbox.init({
skipSetup: true,
players: ['iframe'],
useSizzle: false,
overlayOpacity: 1,
viewportPadding: 5
});
So this https://cdn.whizz.com/whizz-flash.min.js is being called in another of my aspx pages and works there, but that one doesn't include a .master page, and subsequently no tag. My suspicion is, it's a issue.
Thanks for any help.
Anita
|
|
|
|
|
Looking at the full script file[^], it seems the popup creates a <button> element within the modal to open a new page with instructions on how to install Flash.
The event handler for the button doesn't prevent the default behaviour. Since the button is inside a form, the default behaviour in some browsers is to submit the form.
You'll need to find some way to identify the button, possibly via an ID or CSS class on an ancestor element. You'll then need to add a delegated event handler[^] for the button's "click" event, and call the preventDefault()[^] method on the event object.
For example:
document.getElementById("parent-element").addEventListener("click", function(e) {
if (e.target && e.target.nodeName == "BUTTON") {
e.preventDefault();
}
});
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
pls can i reference an iframe of one aspx.vb page inside another aspx.vb page?
if yes then pls help me out with the code behind.....thanks
|
|
|
|
|
The Web does not work that way. Pages are just classes that are instantiated and that generate html which is sent to the client. You can't access the page in VB because it does not actually exist.
What you can do is call methods or function in that class just the way you would any other class.
I think you need to define more clearly what and why you want to do this and there may be another way. JavaScript might be an option.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
No because iframes exist on the client, they are only accessible via code that runs on the client such as javascript. The code on your vb files runs on the server and has no knowledge of, or access to client iframes.
|
|
|
|
|
i am talking about asp.net mvc.
just seen a example but do not understand when people mention url with ajax begin form?
@using (Ajax.BeginForm(new AjaxOptions { Url = Url.Action("Foo", "Bar", null, "http") }))
{
...
}
when we need to post data to different controller and action then url is used?
if yes but ajax begin form has option where we can specify controller and action name then why should we generate url where form will be posted ?
The Ajax.BeginForm takes the following parameters
actionName
controllerName
routeValues
ajaxOptions
htmlAttributes
please help me to understand the url usage with ajax begin form. thanks
|
|
|
|
|
The URL option is used to to set a specific url to POST something to it. The URL option is there so you could specify a full string URL and not just an ASP.NET MVC Controller/Action format thing. So typically in ASP.NET MVC, you could just do:
@using (Ajax.BeginForm("YourAction", "YourController")
to POST to an MVC action. To POST to a URL specific route, you could do:
@using (Ajax.BeginForm(new AjaxOptions {
Url = "http://www.somedomain.com/foo"
}
|
|
|
|
|
i have editor which external user will use to create page. now wicked person can inject something malicious. so tell me how to prevent it?
i will allow user to upload any string data but how could i show it in page as a result html will display nicely but if there js code that will not be executed....just display html.
how to exclude script section from html data when displaying in page. thanks
|
|
|
|
|
Use something like AngleSharp[^] to parse the content, and strip out any tags or attributes that aren't explicitly allowed.
You'll probably also want to set up a Content Security Policy[^] to block inline scripts and third-party scripts that your site doesn't use.
NB: Some older browsers don't support CSP, so you can't solely rely on this to block XSS.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i read article from these links
http://www.dotnet-programming.com/post/2015/04/12/How-to-Handle-Cross-Site-Scripting-in-ASPNET-MVC-Application.aspx
https://www.codeguru.com/csharp/.net/net_asp/preventing-cross-site-scripting-attacks-in-asp.net-mvc-4.htm
they saying to use AntiXSS library. can i use in production? is it robus?
guide me. thanks
|
|
|
|
|
The AntiXSS library is robust and perfectly suitable for use in production.
However, that will completely encode the output. From your original post, it doesn't sound like that's what you're trying to do.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Please let me know the step which is created for an MVC project with angular 4 in vs 2013 or give any reference link
|
|
|
|
|
|
suppose i have a interface from where user insert data to database. database is running in USA pc. user may enter data from USA,UK,Germany and India. so their timezone is different.
so do i need to store date and time as utc format ?
how to send timezone info of user to sql server store procedure and in sql server store procedure convert utc date and time to supplied timezone?
how to capture user timezone id or name which i will use to convert utc date and time to specific user time timezone info ?
i need to develop a application which show data entered by user from different country and data will be stored in USA pc.
please guide me detail.
|
|
|
|
|
Never save timezone information when saving datetime information. Always store dates and times as UTC values. The timezone information is only needed at the user's PC, when converting between local time and UTC.
|
|
|
|
|
at client side how could i convert utcdatetime to local datetime? give me some link or hints.
|
|
|
|
|
|
hi
please give me a code i want to prevent my website from csrf by using csrf-token, i want not to show page url or generate a random code in my url that expires every new time that we click on the link how can i do it?
|
|
|
|
|
There are great number of examples available in Google for CSRF-token.Language obviously you can only know whether you are using java or C#.Net or whatever.Please be specific while you are discussing on some topics.
|
|
|
|
|
We know when a user request a website first time then a session cookie dropped in user pc. If browser cookie is disabled then how session cookie is dropped at client side?
if browser cookie is disabled then session cookie is append at the end of url as query string?
please tell me what happen for session cookie when browser cookie is disabled in asp.net MVC.
|
|
|
|
|
If cookies are refused then the user gets a new session with each request, the site doesn't know it is a returning user. You can configure cookieless sessions in the config which will add a tracking ID to the url instead but this is generally a bad thing.
|
|
|
|