|
I have a form with many dropdowns and text boxes and a file upload.
I want to display the file path as soon as it uploaded without refreshing the entire form.
I am able to upload the file but the file path doesnot get displayed in the label.
however after refreshing the entire page i get the file path displayed in the label
Please help me
|
|
|
|
|
I suppose that you upload your images to "~/Content/images".
The following script may work for you. Pay attention to the attribute "src".
src="@Url.Content("~/content/images/")@item.ImgFileName"/>
You may find more for razor and mvc3 in my article.
http://www.codeproject.com/Articles/565513/How-to-series-about-MVC-jQuery-JSON-paging-mapRout
|
|
|
|
|
Hi,
I have the following url:
www.mydomain.com/signin
that's without .aspx becauzse I am using route mapping like this:
routes.MapPageRoute("volow_signup", "Signup", "~/Signup.aspx");
but sometimes I want to let the redirected to another page other than the member home and I wanted to add this in the url then when the user signed ijn I will redirect him to that page.
How can I do this?
Technology News @ www.JassimRahma.com
|
|
|
|
|
You can pass it as parameter in your querystring like,
www.mydomain.com/signin/newpage=testpage
hope this help you. let me know for your any query.
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
|
I am getting:
A potentially dangerous Request.Path value was detected from the client (:).
Technology News @ www.JassimRahma.com
|
|
|
|
|
check this[^] thread, this may help you.
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
|
hello,
I want to create a section Question of the day on my asp.net web page.What i want is on my home section the question is displayed in short and when a user clicks on view more he is redirected on another page with full questions and links to previous and next questions.I want it to be database driven that is admin can add daily a question.Please help i have no idea how to approach.
|
|
|
|
|
I have a application that did use query strings and IFrames. I changed all of the IFrames to usercontrols and stored what was being passes as query strings to Session variables. In my usercontrols I use Response.Redirect("~/MyPage", true); to navigate. I seem to be loosing Session and was not sure of the cause. My question is does this method of navigation clear session? Also, if this does clear session how can I do a redirection to another webpage from with-in usercontrols & nested usercontrols from the code behind and still retain session?
Thanks,
Steve Holdorf
|
|
|
|
|
I thought the response.redirect took 1 argument.
The session values hold on all pages, the lifetime of using the website unless 20 minutes of non-activity passes by, then it expires.
Or a session.remove is issued.
But you do have to check for the existence of the session object first, before trying to use the value, or before removing or destroying the object.
|
|
|
|
|
The second argument terminates the current response. It's a good idea to set that to true usually.
You are correct, and in my experience this holds true - nothing in the Response.Redirect behavior affects session values.
Possibly he's storing sessions without cookies, and he's losing the query string value which is used in that case to keep the session alive.
Keep in mind, Response.Redirect is a CLIENT-SIDE redirect, meaning control goes back to the browser, and it requests the new page. When that request comes in, it looks like a new request, so if there's no cookie to tell the server the SessionID, it's going to be lost if you don't pass the query string value back as part of the redirect URL. I often take advantage of that to "reset" the current page by redirecting back to itself.
In other words... this might work...
Response.Redirect("~\Page.aspx?" + Request.QueryString.ToString(), true);
|
|
|
|
|
Message Closed
modified 9-Apr-13 14:04pm.
|
|
|
|
|
Yeah if you turn off cookies the session still works by using query strings, and it will default to this mode if a user has set their option to not accept cookies, so you don't have total control over it. It's a good idea to make sure you're saving query strings for that rare case, even if you turn cookies on in the web.config.
This is the key element:
<sessionState
mode="[Off|InProc|StateServer|SQLServer|Custom]"
timeout="number of minutes"
cookieName="session identifier cookie name"
cookieless=
"[true|false|AutoDetect|UseCookies|UseUri|UseDeviceProfile]"
regenerateExpiredSessionId="[True|False]"
sessionIDManagerType="session manager type"
sqlConnectionString="sql connection string"
sqlCommandTimeout="number of seconds"
allowCustomSqlDatabase="[True|False]"
useHostingIdentity="[True|False]"
stateConnectionString="tcpip=server:port"
stateNetworkTimeout="number of seconds"
customProvider="custom provider name"
compressionEnabled="[True|False]"
sqlConnectionRetryInterval="number of seconds">
<providers>...</providers>
</sessionState>
I usually put the "cookieless" to "AutoDetect" because if you pick "UseCookies" and the user has cookies disables, it won't throw an error, but it won't establish a session either. If you're using a web farm, you have to use mode=SQLServer or Custom, where you have to implement session management yourself.
|
|
|
|
|
Hello I am new to ASP.Net, I am getting an error saying
"A potentially dangerous Request.Form value was detected from the client" when I enter a password with special characters "<" and ">" in it, I found some solutions saying add validrequest="false" and requestValidationMode="2.0" I did add both the statements, but no luck, the error is still showing up, Is there any way to resolve this.
Please help me out with this,
Thank you..
|
|
|
|
|
|
Hi,
Ia m sending email from my website. My host told me they have updated the SPF and eevrything is fine. But I am still having a problem.
Emails to Yahoo are getting recieved as SPAM.
Emails to Gmail and Hotmail are not reaching at all. I mean it's sent but it's not anywhere in Gamil or Hotmail... not even in Junk folder.
How can I fix this?
Technology News @ www.JassimRahma.com
|
|
|
|
|
This is not really an ASP.Net question. The problem is most likely with the email content, or the provider. The only thing you can do wrong from the ASP.Net perspective is failing to authenticate on your email server. Since you haven't posted any code, we can't know if you're doing that or not. If you authenticate, and your content is clean, any additional problems you face are probably on the receiving side, and there isn't anything you can do about their rules. If you are not getting a bounce-back, then there's no way to determine why your email is being judged as spam. And, we generally don't give spammers the courtesy of a bounce, we just eat the message and get rid of it.
|
|
|
|
|
You need to create a spf record in your dns zone file, and fine tune the record to state your smtp rules
You may need to use the same sender and domain name for all email transmitted regarless of the websites domain name so the spf record works.
http://www.zytrax.com/books/dns/ch9/spf.html[^]
[EDIT]
you have to register your public ip address with a reverse ptr back to your domain name
So if you have a block of ip's, says 5 numbers and a gateway
gateway = 69.0.0.0
router = 69.0.0.1
mail = 69.0.0.2
www = 69.0.0.3
smtp = 69.0.0.4
and the router is programmed to send all outbound packets out on 69.0.0.1, then you register that ip address as your reverse ptr for your universal domain name.
you can register 69.0.0.2 as mail.domainname.com, but you may not be able to route or create new pckets to go out on that address.
Have your admin call your internet service to register the ip address, and test it.
AOL has a test tool you can use.
modified 8-Apr-13 14:23pm.
|
|
|
|
|
For me, it was simply "make sure reverse IP resolves to the domain name from where the email came" and this can often be tricky because the email server typically doesn't have the same IP as the web server to which the domain name is normally routed. This stuff is in addition to the stuff I said. I had to do this to get through to AOL - but I just called my ISP and said "make the reverse IP lookup work" - that is, I didn't set it up myself as you describe. I forgot about this part, but yeah, AOL will block you for that, and probably other services will too.
It's the "spam unless proven otherwise" rule.
|
|
|
|
|
I spent some time over a couple of weeks having to figure out why I could not send mail to certain mail providers, so it was still fresh in my head. The AOL killed me, because you can't see the message warning using telnet unless your SPF record and reverse PTR is correct. Guess that keeps it secret.
You had a good answer, maybe it is the OP's content after all, but I've never had spam pass the reverse ip lookup test.
|
|
|
|
|
I used to send a newsletter from our server. We always got a few bounce-backs, and we had to throttle the system so it wasn't too fast, because AOL keeps track of your overall activity, and will generate an auto-complaint to your ISP if you send too many emails in a certain amount of time. They tell you what the limit is so you can game the system for legit kind of stuff like newsletters. But yeah, this is why many newsletters and advertisers which have "opt-in" features are explicit about telling you to add the sender to your trusted users list - because sometimes there is nothing they can do to get past the filters.
|
|
|
|
|
When the page is taking time for loading , I kept an update panel and a image for displaying the progress and im manually giving the time to show the progress image, I need a dynamic solution , so that when the data is loaded successfully automatically the loading image should close and has to show the data and if it is taking too much time than whatever i have specified then the image has to show until the data is loaded?
|
|
|
|
|
|
Hi guys,
I want to maintain the selected values of check box and drop down list values in MVC-4 on Post back of page,
ex: I selected Drop down list which contains year, if the user selected 2012 as year on post back of page it should be selected as 2012 value, in classic asp.net we have Page.IsPostBack, is there any same way to do that in MVC 4. because on every post back i am loosing the state of controls, Please help me.
Thanks and regards
Vishwa
|
|
|
|
|
I have a web page(.aspx), on which I'm loading some user control by jQuery ajax.
Something like this:
$.ajax({
type: "POST",
url: "WebService.asmx/GetGrid",
data: data,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result){
$('#divAjaxGridViewContainer').html(result.d);
},
error: function(error) {
alert("Error");
}
});
In WebService.asmx.cs Web Service I have a GetGrid WebMethod which generates and returns the html of user control, that contains grid view. Here is the code:
[WebMethod]
public string GetPage(object[] criteria)
{
Page page = new Page {ViewStateMode = ViewStateMode.Disabled};
AjaxGridView grid = (AjaxGridView)page.LoadControl("~/Controls/AjaxGridView.ascx");
grid.ViewStateMode = ViewStateMode.Disabled;
grid.BindData(criteria);
HtmlForm form = new HtmlForm {ViewStateMode = ViewStateMode.Disabled};
form.Controls.Add(grid);
page.Controls.Add(form);
string result = String.Empty;
using (StringWriter output = new StringWriter())
{
page.Server.Execute(page, output, false);
result = output.ToString();
}
return result;
}
AjaxGridView is a user control, that contains a GridView, and binds it to some data depending on some criteria with BindData(criteria) public method.
All this code works fine. I've used this technique several times and it used to work fine.
This time, after loading the html from service onto the page, clicking the controls that should make autopostback (such as asp:Button, asp:DropDownList, asp:CheckBoxList), throws the following js esception:
__EVENTTARGET is undefined
on this part of code:
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
Any ideas?
|
|
|
|
|
Hi,
Basic idea is, whenever you are loading any control dynamically, you should load in the page_init event of the page. in your case, are you loading (by calling the service) the user control in page Init event ? if not that might be one of the causes of this issue.
hope it helps.
Vande Matharam - Jai Hind
|
|
|
|