|
But with this
$('.Status').click(function() {
var divparent = $(this).closest('.tabs-content');
var ruleid = divparent.attr('data-ruleid');
var statusid;
if (divparent.hasClass('inactive')) {
$(this).closest('.tabs-content').removeClass('inactive');
statusid = 1;
}
else {
console.log('active');
$(this).closest('.tabs-content').addClass('inactive');
statusid = 0;
}
$.ajax({ type: "POST", Url: "NewRules.aspx/SaveStatus",
data: "{strStatus:'" + statusid + "',strRuleID:'" + ruleid + "'}",
contentType: "application/json;charset=utf-8",
dataType: "json"
});
This is not still workingggggggg!!!!!!!
pLEASE HELP
|
|
|
|
|
I don't reccomend trying to bind to a class
$('.Status').click(function() {
but to bind to the element ID instead
Plus you need to test your bind to make sure it works
There are several ways to bind
With update panel
$(document).ready(function () {
initiateBinding();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
});
function EndRequestHandler(sender, args) {
initiateBinding();
}
function initiateBinding() {
$(document).ajaxStart(function () {
});
$(document).ajaxStop(function () {
});
$('[id*="_ddl_RTSR_SARates_Unified_SelectRate"]').change(function () {
alert("I'm Alive");
});
}
with no update panel
$(document).ready(function() {
$('[id*="_ddl_RTSR_SARates_Unified_SelectRate"]').change(function () {
alert("I'm Alive");
});
});
So test the bind first, then move on to the function code and report back, I'm leaving in 30 minutes today
[edit]
test your data,
alert("{strStatus:'" + statusid + "',strRuleID:'" + ruleid + "'}");
copy the messagebox contents using firefox and paste it into the json validator to make sure it's valid json
http://jsonlint.com/[validator^]
you have to use slashes to escape out the double quotes
"{\"m_Rate_API_Code\" : \"" + rate_API_Code + "\"}"
Your JSON doesn't look valid to me {"name" : "Jim"}
modified 21-Mar-13 18:05pm.
|
|
|
|
|
the binding works, the console.log shows that. and the parameters are just numbers, what is wrong with them?>
The thing is the page is postback but the webmethod is not running, it only goes to pageload!
and One more thing! Sys is not a valid name when I tried to use it!! I don't know why!
|
|
|
|
|
You should call the web method page directly, and see if the debug interface comes up, enter your value and test it.
[edit]
on the Sys is not a valid name, the Sys exist if the button you binded is inside an update panel.
With out the example I provided, you will lose the bind when the panel updates,
if you don't have an update panel, then it's just the on ready function.
Without seeing the project, it's hard to say why the page is not firing, but most likely it an error in the page name or extension.
modified 22-Mar-13 14:22pm.
|
|
|
|
|
How do you debug a single ASPX file?
I am somewhat new to ASPX files, but I am not new to C#.
I figured that all asp.net c# projects were run on the server as compiled code. And so there was some sort of binary file somewhere somehow or maybe a XAP file like they have with silverlight.
But it seems that this is not the case. it seems that, sometimes, you can have an ASPX file along with the code-behing C Sharp file and it runs just like a PHP file. For starters, is that right? Am I right so far?
Now, if I was the owner of both the ASPX file and the CSHARP code-behind file, how would I go about debugging it in Visual Studio?
|
|
|
|
|
To the best of knowledge
You have the web form, which is HTML and combinations of asp.net objects, similar to a PHP page
and code behind forms, that you write code in. asp.net objects can link to code behind using handlers, that point the code to the web form object.
The objects in asp.net, can be used 2 ways, on the web form as a HTML type of element, or in code behind in pure code.
When you run your project, asp.net will compile your code as various DLL files, and store them on the c drive under windows\Microsoft asp.net.
To debug your project, you press F5 using Visual Studio, you have to load the page you want to debug first, and set a break point by pressing F9 on the line of code you want. I think you can only debug code behind pages.
|
|
|
|
|
the file is https://www.seattleu.edu/admission/nonMatricLander.aspx
and out on the server there is just the aspx file and the accompanying .cs file
that is all there is. There is no solution file, there is no default.aspx file there is nothing else in the that directory apart from other .aspx files and aspx.cs files.
If it was a web form, there would be a project file and and or a solution file. There would be something compiled, right? There is nothing like that. there are no dll files.
How do I run the code?
My point is that there is no project to load. There is only a file.
After setting a break point, there is nothing to run. I have tried attaching to the browser that has the aspx code loaded but then the breakpoints become inactive.
|
|
|
|
|
You can only debug a project or page that is on your hard drive, if the page you posted is crashing, then you have to look at the stack trace, and work your way down the list to find the line of code that bombed.
[edit]
are you trying to reverse engineer the page?, or seriously need to fix something?
modified 20-Mar-13 23:34pm.
|
|
|
|
|
I think I need to do this. I need to run the code locally through "localhost" and attach the process through the debugger. How do I run the localhost?
|
|
|
|
|
If the project is on your hard drive, and your using VS 2010, you press F5 on the page selected, and it will run on the localhost.
What are you trying to fix, is it a javscript issue, or asp.net code behind.
|
|
|
|
|
Hello folks,
I thought this would be very simple. but I am not able to.
I tried simple code like this using href element. But it tries to open the sheet.xls in the browser window and says it can't find the file. I want the excel file to be opened in excel (not browser). Any suggestions?
<a href="file://domainname/vol1/destinationfiles/sheet.xls" >some excel file</a>
The excel file I am trying to open is not on IIS server. It is on file server.
Thanks much
nath
.
|
|
|
|
|
Where do you expect the excel file to run? On the server side?
Remote launching of apps at the client end is possible, but I doubt that you can do this directly (see below) from web server code. Also presumes they have Office installed on the remote machine.
Remote execution needs to be enabled/allowed at the far end.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
Strange. I also thought it was easy.
But on my system, every call to a href="file:..." fails when the page containing the link was obtained via http.
Such links do work only when the page was opened with the file protocol. And the links do fail when the file to be opened is not on a local or mapped drive. Browsers offer to open the file (with Excel) when it is on a local/mapped drive or just download it.
I tested with current versions of Internet Explorer, Firefox, Chrome, Opera, and Safari.
|
|
|
|
|
Well I've never had to try it,
The web server would most likely need to generate a local script with *application name hard coded*, then execute via a shell COM object. The local script can then do some remote checking of its own, and then launch the remote application. (Windows Script Host)
That's how I would try to do it.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
After export gridview to excel using asp.net and vb.net
Save as Type:Web Page. I want it should be Microsoft Office excel workbook
My code like this
====================
gvRpt.AllowPaging = False
gvRpt.GridLines = GridLines.Both
Dim style As String = " .text { mso-number-format:\@; } </script> "
Response.ClearContent()
Response.Clear()
Response.Buffer = True
Response.Charset = ""
Me.EnableViewState = False
Response.AddHeader("content-disposition", "attachment;filename=" & RptName & ".xls")
Response.ContentType = "application/excel"
'Response.ContentType = "application/vnd.ms-excel"
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)
gvRpt.RenderControl(htw)
Response.Write(style)
Response.Write(sw.ToString())
Response.End()
|
|
|
|
|
try below code.
gvRpt.AllowPaging = False
gvRpt.GridLines = GridLines.Both
Dim style As String = "<style> .text { mso-number-format:\@; } </script> "
Response.ClearContent()
Response.Clear()
Response.Buffer = True
Response.Charset = ""
Me.EnableViewState = False
Response.AddHeader("content-disposition", "attachment;filename=" & RptName & ".xls")
Response.ContentType = "application/vnd.ms-excel"
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)
gvRpt.RenderControl(htw)
Response.Write(style)
Response.Write(htw.ToString())
Response.End()
hope it works.
Vande Matharam - Jai Hind
|
|
|
|
|
What is the Different my code and this codde?
|
|
|
|
|
Also you did not see it on the first view? Just one variable in one line was changed:
Your line is:
Response.Write(sw.ToString())
His line is:
Response.Write(htw.ToString())
I.e. sw was replaced by htw .
|
|
|
|
|
Blank Excel File generated.
|
|
|
|
|
Hello All,
I am having issues with maintaining info when person uses browser back button. I work for a company which is an online traffic school course. The issues I am having is say a student starts on lesson 1. Within lesson 1 there are 10 pages of content that they must read and click Next button to go to next page. Once they then have read all 10 pages, then they go to a quiz where they are given one question at a time (there are 5 questions). They click Next button to move to each question. Once they have answered all questions, then they go to a grade page. If they passed, then they click on continue button to go to lesson 2. Then onto quiz for lesson 2. This part all works great and if they click our programmed Back buttons everything works great as well. The problem is if they go from say lesson 1 all the way to lesson 3 (just an example) and they decide to use the browser's back button to go all the way back to lesson 1, everything tends to get messed up. Since we are driving off of class Student which contains current lesson num, current page num, current question num, once we advance further in the course these values get updated. My problem is that when the student continuously clicks the browser's back button the lesson num, page num and question num (and other content) does not follow suit to what it was. I am not sure why, but the pages are not being cached. Is there anyway to maintain the lesson num, page num and question num as the student clicks browser back button? Meaning as they click back to quiz from lesson 2, it shows lesson 2 (it is currently showing lesson 3 since that is how far have advanced) and same with the lesson pages that they must read. I have tried to use hidden input, but it does not seem to work correctly all the time. Any ideas???
Thanks,
Brad
|
|
|
|
|
I ran into that with eCommerce checkout, in which they move forward, and then go backwards. Then when they use the browsers back button, I lost some data.
I had to rethink the design of the checkout. I had the basic foundation correct, but had to make some modifications.
Your probably going to need to add a column to your table, lesson complete as boolean, and not allow the student to change lessons until completion, in a linear manner.
So if no lessons are complete, they can only access lession 1, and so forth.
|
|
|
|
|
I am not sure that I quite follow you. The students cannot move to next lesson with out moving through all of the pages of the lesson content and passing the quiz. So they do move forward in a linear manner. The problem is if they go all the way through lesson 1, pass lesson 1 quiz, now they go to lesson 2. If they now click the browsers back button all the way back to lesson 1 quiz question 1, that is where I seem to notice the problem. It shows lesson 2 quiz question 1. I would have thought that all the previous pages would be cached as the student clicks browser back button since it is only client side and is not going back to the server to retrieve any info. But for some reason it is not caching all of the pages. Is there a limit to the number of pages that will be cached?
|
|
|
|
|
Well you don't let them go back to lesson 1.
You place a catch function in the page.load event of every page, that validates if that lesson was completed, and if so, it redirects them back to the lesson menu or a sorry page, then another redirect to the lesson menu.
[EDIT]
You have to think 2 ways, one using your back and forward buttons, and one using the browsers back and forward buttons.
So you add some extra code for every lesson page, that first validates access to the page using the browser buttons.
One other thing to consider is condensing the entire lesson into a single page, using Javascript to control lesson panels or containers, so containers just open and close and they don't have to leave that page.
[2nd Edit]
Saving Page Number, Lesson Number data
You can save that in the session, but if they leave and come back, then the session number has to match, if they clear there browser cache, then the session is gone. The cache last as long as the browser will store it, or reaches it's storage limit, or until it's erased.
In my opinion, each page has to be independent in operation, in other words, the page has to be able to remember or fetch the data needed to pick up where it left off, without dependence of the previous page.
So overall I'm saying that it can't be fixed with something easy as remembering data in the session or querystring, it's at the program design level, in which each time an action occurs, it should update the table, and you check the table to figure out what level and lesson they are on.
modified 19-Mar-13 16:53pm.
|
|
|
|
|
I have a MVC 4 application which I've added some administrative pages implemented as WebForms.
The application starts on the Home controller, Index view, where I have a link to one of my Admin pages.
<a href="~/AdminUtils/WebForm1.aspx" title="Form 1">Webform1 Here </a>
The link works correctly because my page is redirected to the Webform1.aspx page. The problem is that the resulting URL I see in my browser is:
http://localhost:63163/#/AdminUtils/WebForm1.aspx[^]
Notice that there is a # (hash) symbol in the URL. The problem I'm having is that I have a 3rd party Grid on that page which is not operating correctly. If I manually change the URL to remove the # symbol, then the grid works perfectly.
Anybody know why this # symbol is showing up in my URL ? How can I get rid of it ?
Thanks.
|
|
|
|
|
|