|
Buy a book on ASP.NET. Look for books with the word 'dummies' in the title. Read it, and try to get a basic understanding of what ASP.NET is, and does. When you have a clue what you're working with, you'll know why there's no way you could ever hope to do this.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Greetings ..
I sit for several hours before the problem and still can not find a suitable answer.
Javascript is not exactly my forte, so I just ask once.
I want to do the following:
I have a matrix with various Checbox. This will be filled by a database in C #. If a checkbox has been clicked, ie onclick, an inquiry should be sent to the database to read from the DataBase If click the checkbox in the matrix on C #, now is the time a database query with a WHERE = presentValue be started.
http://img17.imageshack.us/img17/760/unbenanntpw.jpg
From the database should be read out what people can C #.
My problem is mainly in the transfer the collected values of javascript in ajax so that the database sends the request to obtain an answer?
I am grateful for any information
|
|
|
|
|
Create a string contains the values using javascript and submit to server as a query string. In the server, you have to implement the logic to filter the values.
|
|
|
|
|
thanks for the answer
I create a string contains the values using javascript and submit to server as a query string. In the server, you have to implement the logic to filter the values.
I collect my values with a JavaScriptFunction
function GetAllChecked() {
var checkboxes = document.getElementsByName("skill");
var s = ""
for (var i = 0; i < checkboxes.length; i++)
if (checkboxes[i].checked)
s += checkboxes[i].value + ";"
;
;
document.getElementById("hhidAcrobat").value = S;
}
exactly what I'm doing wrong?
|
|
|
|
|
Did you debug this code? what is the value of variable s after the loop? how you submit this value to server?
|
|
|
|
|
the value of my string in Js contain "43;44;45;46;47;48;49;50;51;52;53;54;"
how should i tranfer this string to my database?
|
|
|
|
|
Post this string as a query string to the target URL using XMLHttpRequest object.
|
|
|
|
|
thx for ya idea, will try it
|
|
|
|
|
I don't know what element "skill" is, but there is no HTML element that represents a "checkboxlist" so I'm guessing it's a container for the checkboxes.
Try changing the first line to
var checkboxes = document.getElementsByName("skill").children;
If it still doesn't work, attach your debugger and use the watches to see what's in the variables. If you don't know how to do this, take the time to learn it as it'll save you a huge amount of time in the long run.
|
|
|
|
|
|
It's not very clear (at least to me) what exactly the problem is. Nor can we know what AJAX implementation you are using - and there are many available.
You could of course create your own ajax implementation, but it may be a good idea to take a look at what's out there first since you'll probably find something that fits your needs and can handle more than you need too, which is good since you'll then be less likely to have to find another as requirements evolve (and they *always* evolve, unless the app is so unsuccessful that it's scrapped right away).
In general, what you're describing would consist of the following steps:
1) Collect the information that is necessary in order to query the database from the UI. Since the UI is in the browser, you'll most likely do this in JavaScript.
2) Send a request to the web server that indicates an operation and includes the above information. This too is in JavaScript, but how exactly depends on what AJAX implementation you're using.
3) On the web server, build an IDbCommand (e.g. an SqlCommand) to query the database or call a stored procedure, and execute it to get the information you need and/or do any other work the operation includes.
4) Return something to the client.
What to return depends entirely on your requirements. You should always include some indication of success or failure, so the client can inform the user in the event of an error. It may be useful to include debugging information at least in your dev environment, such as an exception stack trace. If the UI is going to display data as a result of the operation, you have the choice of returning the data and use DHTML and JavaScript to modify the UI (more scalable), or rendering the HTML server-side and return it to the client (more powerful if you use an AJAX framework that allows you to do this).
There is a "default" ajax-implementation of asp.net, and although it's not very high performance it may be a good choice (and probably fast enough). Google for "asp.net callbacks" and "asp.net updatepanel" to find tons of tutorials, documentation and code. The great thing about this implementation is that it plays nice in combination with normal postbacks. (Changing almost anything on the client with js can cause problems (related to viewstate), but asp.net callbacks do not, which is both why it may be good and why it's slower than some "pure" ajax implementations.)
If you are already using some third-party ajax framework or a custom implementation of your own, at least clarify what step in this process you're struggling with and what (if anything) you are doing, errors you are getting, and so on.
|
|
|
|
|
That there is a updateplanel I have seen. It loads only a portion of the site. And my portion, the user should be having my skills.
|
|
|
|
|
Hi,
To avoid any helpful but irrelevant answers: I'm not talking about deployment here, only of my dev environment!
I am using VS-2008 and wish to target Framework 3.5 and use the v3.5 C# compiler. (It is of course possible to use Framework 2.0 libraries with new compiler features such as type inference or anonymous types.) But for some reason this project (the only one of 19 in the solution!) apparently gets built for 2.0 or using a v2.0 C# compiler.
The web project appears in solution explorer as "http://localhost/dev/" (I call this the "web project" but there is no project file and I believe this is what MS calls the "web site" model, as opposed to the "web application" model). I can't find any compiler options.
If I right-click the web site in solution explorer and choose "property pages", then go to "build", the Target Framework option is ".NET Framework 3.5". But if I right-click the site and choose "build web site", the project will not build if any using directives referring to Linq namespaces are included, nor if any code in the site uses C# features newer than C# 2.0, such as
var x = 5;
(While this code itself is stupid it's a good example because this clearly only depends on the compiler and not on the framework version.)
If I fire up the browser and point it at my site, the dynamic compilation process gets underway and produces a build error ("CS0246: The type or namespace 'var' cannot be resolved", loosely translated from French as I unfortunately have to work in the French locale). At the bottom of this standard asp.net error page it says
Version Information: Version Microsoft .NET Framework :2.0.50727.3082; Version ASP.NET :2.0.50727.3082
Any idea how to correct this and use Framework 3.5 and the v3.5 C# compiler? I've searched MSDN and found nothing helpful; it always points me to the property pages where it already says this project is targeting 3.5!
|
|
|
|
|
Hi all,
In many sites if we click the FAQ or help title then it will go to the corresponding content. Please help me to derive that.
|
|
|
|
|
I think you are talking about the anchor [^]tag. Look at the link, and probably what you need is the second point (i.e. bookmark inside a document)
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi Bhardwaj,
Thank you for your reply. I got the solution.
|
|
|
|
|
Hi,
Can any body give me a hint from where can I download sample icepak model files. I have googled extensively, I could find few.
Please Help!
Regards
Mukti
|
|
|
|
|
Member 3243250 wrote: Can any body give me a hint from where can I download sample icepak model files. I have googled extensively, I could find few.
How is it related to ASP.Net?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I used gridviewrowcreated event in order to create a heading row for the grid
First time it executes well after that for every event that is fired on the page the control is coming directly the gridviewrowcreated event
How can i solve this problem?
|
|
|
|
|
It is hard to assume the problem from your obscure post. Do you want write some code that should execute only when the creation of header row? Then you should write it in an "if" block which checks the row type is header row.
|
|
|
|
|
if (e.Row.RowType == DataControlRowType.Header)
{
//Build custom header.
GridView gvGrid = (GridView)sender;
GridViewRow gvRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
TableCell tblCell = new TableCell();
TableCell tblCell1 = new TableCell();
//Add Department
tblCell.Text = "Attendance Report From:" + Convert.ToDateTime(sFromDate.ToString()).ToString("dd/MM/yyyy") + "-" + "To" + Convert.ToDateTime(sToDate.ToString()).ToString("dd/MM/yyyy");
tblCell.ColumnSpan = 6;
tblCell.ForeColor = System.Drawing.Color.Black;
tblCell.Font.Bold = true;
tblCell.Font.Size = 14;
gvRow.Cells.Add(tblCell);
tblCell.HorizontalAlign = HorizontalAlign.Left;
gvGrid.Controls[0].Controls.AddAt(0, gvRow);
}
I used this code first time it executes well after that when any event is fired on the page the control comes to this rowcreated event its not even entering into page_load and all the text in the textbox controls were being cleared
modified on Thursday, October 8, 2009 12:42 AM
|
|
|
|
|
Is the page is loaded with !ispostback.
|
|
|
|
|
try to keep the breakpoint on all the events which are present in the code page..!Then try to debug the page You can find the error..!
|
|
|
|
|
i tried it but could not found
|
|
|
|
|
I am taking three dataset and i want to bind all dataset value in a single gridview.so plz can help me????????
vivek sachan
9582134764
DataSet ds = dut.getDataSet("select Class,CurrentLevel,Name from Tbl_StudentDetails where RollNo='" + Request["RNo"].ToString() + "'");<br />
foreach (DataRow DR in ds.Tables[0].Rows)<br />
{<br />
string s2 = DR["Class"].ToString();<br />
string s3 = DR["CurrentLevel"].ToString();<br />
string s4 = DR["Name"].ToString();<br />
}<br />
<br />
<br />
DataSet ds1 = dut.getDataSet("select count(Status) from Tbl_Attendence where RollNo='" + Request["RNo"].ToString() + "'");<br />
foreach (DataRow DR1 in ds1.Tables[0].Rows)<br />
{<br />
<br />
string s5 = DR1["Status"].ToString();<br />
}<br />
<br />
DataSet ds2 = dut.getDataSet("select FMonth,Fyear,TPendingFee,Fees from Tbl_SFee where RollNo='" + Request["RNo"].ToString() + "'");<br />
foreach (DataRow DR2 in ds2.Tables[0].Rows)<br />
{<br />
string s6 = DR2["FMonth"].ToString();<br />
string s7 = DR2["Fyear"].ToString();<br />
string s8 = DR2["TPendingFee"].ToString();<br />
string s9 = DR2["Fees"].ToString();<br />
<br />
}
|
|
|
|