|
You upvoted the question.
|
|
|
|
|
|
how to make a textbox datepicker in asp.net framework 4.5,
and using this in a content page
|
|
|
|
|
Not just use in asp.net project,also use in other type page,like php,jsp and so on!
let's show you my ways!
put this in page header
and write a script
$(function() {
$('#birthdate').datepicker({
format: 'yyyy-mm-dd'
});
});
the birthday is the input control number!
|
|
|
|
|
I have issue that is Session Automatically Expires even session time-out sets to it maximum level. I am developing my web application in a ASP.NET MVC 5 With WEB API . There is no issue when I run it in local but when I publish it on web it session automatically expires within 55-60 seconds. Hosting provider also says that there is no issue with their server. I can not find any error and don't know how to configure it . My < system.web > configuration in web.config file is as follow . Check this link - http://pastebin.com/uvPVKDQU
|
|
|
|
|
Try having a file system watcher and see if web.config or some application files are being inadvertently modified (at least by timestamp) by indexing service, virus or other scanning service.
|
|
|
|
|
The session is controlled and stored by the web server, not the web app.
Or you can have an SQL server like SQL Server Express store session values as well.
The Web App, Webforms or MVC is able to add, set and delete session values.
The web.config allows you to override the settings of IIS server. In other words, you can almost completely setup the IIS Web site environment within the Web.Config file.
You have to run test in order to isolate the problem area, use critical thinking here.
So make a Session value called Test, put it on the home page, and run the page once an hour over 12 hours or so, and see if the value persist.
Response.Write the value or put it in a textbox at the top of the page.
If the value persist, then it's your MVC app.
httpcontext.current.session.add("test", "persist")
txt_text.text = httpcontext.current.session("test")
|
|
|
|
|
cookieless="true " once try this
|
|
|
|
|
Hi All,
I have a text box which should be disabled, but when I tried to set the value of the text box using jQuery as below, the value is not getting posted in the code behind. I tried by making the Text box read only also, still the value is not getting posted, actually I want to make it disable only but still tried with read only to see if it can be posted.
Please anybody please help me in resolving the issue, any help like a code snippet, link or even a suggestion would help me a lot.
Below is the code and Text box I have used
$("[id$='txtBirthDate']").val(moment(updatedBirthDate).format("MM/DD/YYYY"));
<asp:TextBox ID="txtBirthDate" runat="server" ReadOnly="true" /> Or
<asp:TextBox ID="txtBirthDate" runat="server" Enabled="false" />
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Disabled controls will not be included in the data posted back to the server. This is standard behaviour for all browsers, and has been since HTML forms were first introduced. There is no way to change this, short of removing the disabled attribute just before the form is submitted.
Read-only controls will be included in the data posted back to the server. However, looking at the code[^], if the ReadOnly property is set, the posted value will be ignored.
If you can work with the control being read-only rather than disabled, then you can set the readonly property from Javascript instead:
<asp:TextBox ID="txtBirthDate" runat="server" />
$(function(){
$("[id$='txtBirthDate']").prop("readonly", true);
});
Otherwise, you'll need to clear the disabled property before the form is submitted:
$(document).on("submit", "form", function(){
$("[id$='txtBirthDate']").prop("disabled", false);
});
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Awesome yes but in this mean time I fixed it by putting a hidden field there, but your solutions look good to me. Thank you.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
$('[id*="_txt_Focus_Field"]').val();
your missing the *
|
|
|
|
|
I am trying to create cross domain web api, however I am still unable to call data from web api url, in my ajax function. I am currently experiencing the following syntax error, under the networks, response tag.
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
The ’/ api/stw’ is currently being reported as 405 error, however when I call - http://apitesting.domain.com/api/stw, I am able to see the data is JSON format. So, I am little unsure, why is it failing in the ajax function.
$(document).ready(function () {
$.support.cors = true;
$.ajax({
type: "GET",
crossDomain: true,
contentType: "application/json; charset=utf-8",
// url: "/api/stw",
url: "<a href="http://apitesting.domain.com/api/stw">http://apitesting.domain.com/api/stw</a>,",
data: "{}",
dataType: "json",
success: function (data) {
console.log(data);
// var myData = JSON.parse(data)
for (var i = 0; i < data.length; i++) {
$("#tbDetails").append("<tr><td>" + data[i].Name + "</td><td>" + data[i].loan + "</td><td>" + data[i].evnt + "</td></tr>");
}
},
error: function (result) {
alert("Error");
}
});
});
I am currently hosting my cross domain web api on the above url. I have added the custom headers in the web.config file of my web api. I have also added ‘enabled.cors’ property in my stwAPIController. I tried parsing the data in ajax through the following method ‘JSON.parse(data)’,but I am still getting the same error, as mentioned above.
[EnableCors(origins: "http://apitesting.domain.com/api/stw", headers: "*", methods: "*")]
public class STWController : ApiController
{
private cdwEntities db = new cdwEntities();
<pre>
public IEnumerable<Loan> getData()
{
var data = db.Database_CRE_LoanEvents.Where(c => c.Date.Contains("2015") && c.Loan_property != null)
.Select(x => new Loan() { Name = x.Deal, loan = x.Loan_property, evnt = x.Event })
.ToList().Take(3);
return data;
}
}</pre>
Any further help, would be very much appreciated.
|
|
|
|
|
Your JSON parser says, that the token wasn't expected. This happens either when you're trying to parse array to object or object to array. Please make sure types match.
Also what do you mean by cross domain? Do you stumble upon CORS?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
- Well as far as I know, Javascript and jQuery doesn't allow you to do cross domain calls, to protect the website from false calls to web services within your web site. But on the flip side of the coin, I know you cal call card processing services from jquery, so I need to update my knowledge on that.
- You need to check your script for errors on something like http://www.javascriptlint.com/online_lint.php[^]
- With Javascript and JQuery, you really need to use the single quote char, and not the double quote char. by using the single quote char to wrap text values, you can use the double quote char without having to escape it
e.g.
var html = '<div style="classname"></div>';
I can't tell why it's not working, but you should code it correctly first before moving forward, you could just be getting the error after the first error.
$(document).ready(function () {
2 $.support.cors = true;
3 $.ajax({
4 type: "GET",
5 crossDomain: true,
6 contentType: "application/json; charset=utf-8",
7
8 url: "<a href="http:
============================^
SyntaxError: missing } after property list
9 data: "{}",
10 dataType: "json",
11 success: function (data) {
12 console.log(data);
13
14 for (var i = 0; i < data.length; i++) {
15 $("#tbDetails").append("<tr><td>" + data[i].Name + "</td><td>" + data[i].loan + "</td><td>" + data[i].evnt + "</td></tr>");
16 }
17 },
18 error: function (result) {
19 alert("Error");
20 }
21 });
22 });
|
|
|
|
|
I want to start with asp.net mvc and I am absolutely lost with terms and concepts.
I work through a lot of microsoft trainings. But all samples mix up endless different concepts and terms.
Can somebody give me a link to some kind of "bottom-up-tutorial"?
modified 1-Apr-15 7:20am.
|
|
|
|
|
|
Hopefully, you will like this article[^] of mine about ASP.NET MVC framework.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
To your comment for that answer "Not Clear sir,I'm new to MVC.", please read that article I have attached.
The answer to that (sorry for going off-topic related to this thread), is that you need to send the information about your View and some other controls which were interacted through user. Which is a very common task in WPF, or Win Forms. If you view event handlers in those frameworks you find out this code,
void button_Click(object sender, EventArgs e) {
var button = sender as Button;
var name = button.Name;
}
In which, sender is the object which triggered this event. So, if you cast it to a Button object and so on.
In ASP.NET you do not get such functionality by default, which is why you have to create such functionality yourself. Which, in my opinion would be best to use native forms. Which get submitted (using action attribute) to their own pages for processing. So you can redirect the user to where you want him to be. This way, you will check for values that are related to the controller action; SignUp or SignIn . Do not complicate things, use the simplest method that can be used. It was also pointed out, that you're having variables for your HTTP GET handler, not HTTP POST. Use a model to establish similarity, or... You can use JavaScript to control how things are handled on the client (handling click on SignIn or SignUp).
Also what he tried to tell you was same, that you were having the member profileList inside your GET handler, but not inside the POST handler, where as once the form was to be submitted, it was using the POST handler action, so there was a mismatch between the ViewBags and thus caused this problem. That is why he suggested that you use a Model.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I rarely found such a good training site in my life
Thank you very much
|
|
|
|
|
you are welcome.
நெஞ்சு பொறுக்கு திலையே-இந்த
நிலைகெட்ட மனிதரை நினைந்துவிட்டால்
|
|
|
|
|
Yes, here is an article[^] that I wrote for beginners like you. You can read it, it will guide you throughout the basics of ASP.NET MVC framework.
I hope you will find it helpful.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
Thanks a lot for these very helpfull information. Much better than what I found so far
I have another one
The views I found in many examples contain more or less a lot of html-code. Is is possible to use a kind of "graphical html-designer" to create this native code automatically?
|
|
|
|
|