|
I have a treeview in the lefthand side of my aspx page. When I clicked on any of the nodes, there will be a grid showing the details on the right hand side. There is an edit button also for each row for editing the details. Everything is working perfectly fine.
The issue: if I clicked on the Edit link, Update and Cancel button will apppear in the Grid. And without performing any updating(means without doing any edit), if I clicked on the left hand side of any other node, corresponding details will appear in the Grid without collapsing the row. if I code as below, update event itself is not firing.
if (GridView1.EditIndex >= 0)
GridViewEditIndex = -1;
Anybody have any idea why it is happening? How can make the row collapsible even though the Update and Cancel button in the Grid is open in GridRow? Please help. Please let me know if I need to provide more info.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi Everyone
I have an application that is running fine on my development and QA environment but it's giving me problems on production. I get an error "Child nodes not allowed"
on thi sline "<providerOption name="CompilerVersion" value="v3.5"/>;"
Parser Error Message: Child nodes not allowed.
Line 126: compilers
Line 127: compiler language="c#;cs;csharp" extension=".cs" warninglevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Line 128: provideroption name="CompilerVersion" value="v3.5"
Line 129: provideroption name="WarnAsError" value="false"
Line 130: compiler
So I would like assistance at what is the cause and how to solve this problem.
Thank you
Mpumelelo Khuzwayo
MP
|
|
|
|
|
This should be a common need but I haven't found a method so far. What i want to do is, in a result from a SQL Query, define some columns to be, say, Full Name on load to the datagrid rather than 3 cols for first, mid and last name. so, no joins, just select from db, manipulate data, bind to datagrid.
Currently i am using DataTable as I only need read-only to the data. this code looks like it might work:
Dim resultsDataSet As New DataTable()
Dim FullName() As DataColumn = { _
resultsDataSet.Columns("FIRST_NAME"), _
resultsDataSet.Columns("MID_NAME"), _
resultsDataSet.Columns("LAST_NAME")}
Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter(cmd)
myDataAdapter.Fill(resultsDataSet)
DisplayResults.DataSource = resultsDataSet
resultsDataSet.Columns.Add(FullName(2))
DisplayResults.DataBind()
But I get the error "'column' argument cannot be null." when i try to load the datagrid. also, i don't know what i should but in the declared array FullName() during bind - 2 is a guess based on the fact that there are 3 columns defined for this one. In addition, it's *OK* to have the new table be null if First, Mid and Last (name) is in fact not given in the data source.
TIA
Issue resolved - I did the concatenated table in the db instead.
modified on Monday, February 23, 2009 11:03 AM
|
|
|
|
|
FYI if you are doing read only, the sqldatareader is more efficient. Especially for larger result sets.
I didn't get any requirements for the signature
|
|
|
|
|
i suppose you mean to replace
New SqlDataAdapter(cmd)
with New SqlDataReader(cmd)
|
|
|
|
|
Something like this...
string queryString =
"Put your sql here and use parameters if necessary";
using (SqlConnection connection =
new SqlConnection(connectionString))
{
SqlCommand command =
new SqlCommand(queryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
DisplayResults.DataSource = reader;
DisplayResults.DataBind();
// Call Close when done reading.
reader.Close();
}
I didn't get any requirements for the signature
|
|
|
|
|
thanks - i'm new to all this and it's good to be reminded of when to use what in the ADO.NET world.
|
|
|
|
|
Hi all.
I have .NET web application, which gives user overall sales performans and uses iframe to load some detailed sales data. Because of that iframe design the applicaion is loaded slower at first run (I guess it has to load 2 pages: the main and the iframe page). The question I have is: If I increase memory on my server will the application run faster?
Thanks.
Alex.
|
|
|
|
|
alexfromto wrote: The question I have is: If I increase memory on my server will the application run faster?
Probably not.
I have a suggestion for you...
Check your IIS Settings, you will see that the amount of ram each application pool can use is configurable.
Your issue could be a sql query that is not optimized. How long does the sql query take to run?
If that isn't the issue you could install this http://www.jetbrains.com/profiler/[^]
It will enable you to determine how long each .net method is taking to execute.
If that doesn't help you could install fire fox, firebug and http://developer.yahoo.com/yslow/[^]
Basically, you need to rule out a hole host of issues before you go adding ram to your web server.
I didn't get any requirements for the signature
|
|
|
|
|
I had created a very simple PHP page that would read in a value from a wiki webpage, then use that number to retrieve information for a different wiki page, and spit the whole thing out into a purely HTML webpage. Recently, we moved our site over to a Windows server, and the php page no longer worked. I managed to throw together an HTML/javascript equivalent, but I'd really like to do all of this work on the server instead of on the client, in order to hide the "guts". I'm hiding them for ethetics, not security, and so that the page, once retrieved, can be viewed offiline. Can someone tell me how to do this in asp and vbscript please?
Here is the PHP page:
<html><head><title>Helpful Hints</title> </head>
<body>
<?php <br mode="hold" /?>
$configFile=file_get_contents('http://www.mysite.com/wiki/data/pages/internal/helpfulhints/numberofpages.txt');
$somenumber=rand(1, ($configFile*1));
$filename='http://wiki.mysite.com/doku.php?id=internal:helpfulhints:hint'.$somenumber.'&do=export_xhtmlbody';
echo file_get_contents($filename);
?>
<br />
</body></html>
and here is the Javascript version:
<html><head><title>Helpful Hints</title> </head>
<body>
<script lang="javascript">
function file_get_contents( url ) {
var req = null;
try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {
try { req = new XMLHttpRequest(); } catch(e) {}
}
}
if (req == null) throw new Error('XMLHttpRequest not supported');
req.open("GET", url, false);
req.send(null);
return req.responseText;
}
var numberofpages = file_get_contents('http://wiki.mysite.com/doku.php?id=internal:helpfulhints:numberofpages&do=export_raw');
var randomnumber = Math.floor(Math.random()*numberofpages)+1;
var message = file_get_contents('http://wiki.mysite.com/doku.php?id=internal:helpfulhints:hint'+randomnumber+'&do=export_xhtmlbody');
document.write(message);
</script>
<br />
</body></html>
Thanks!
|
|
|
|
|
Hii,
Am new to ASP.net.
And am very curious to know from where could i get the required resource to understand the life cycle of page when it is requested to server to the time, when server responses back to browser in asp.net 2.0.
I want to know in depth about what process takes place at server.
How server process page request and all in details.
Where could i get these understanding from?
Can anyone refer me to a site where probably i could download some free e book or any presentation which gives me full understanding on the process taking place between a request submitted to server, to response received from server in depth/detail.
Guide me, if any one can for this topic to better understand asp.net.
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
|
Hi.
How could I access session in a pure class (not a webForm)
Best wishes
|
|
|
|
|
You cant.
Call a Function that needs the value from the Session Variable in your Page and pass in the Value from the Session variable in your page and it will pass the Value to the Class Function or Method
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
My best guess:
object zObj = System.Web.HttpContext.Current.Session["MyVariable"];
var question = (_2b || !(_2b));
|
|
|
|
|
using System;
using System.Web;
public static class SessionItems
{
public static string YourSessionValue
{
get
{
Object result = HttpContext.Current.Session["YourSessionValue"];
if (result == null)
return null;
else
return (string)result;
}
set { HttpContext.Current.Session["YourSessionValue"] = value; }
}
}
I didn't get any requirements for the signature
|
|
|
|
|
Hi.
How could I add a Euro sign at the end of items of a coloumn of a gridview.
I have added the & euro ; (not seperted) at the end of my items, but it shows the & euro ; string itself, not the sign.
Best wishes
|
|
|
|
|
Hi,
Try doing it in RowDataBound event.
I guess you will be able to do it there successfully.
|
|
|
|
|
Hello Everybody
I have 4 radio button on my page and their Group Name grpSelection.
'On button click' How do I know which radio button is seleted?
Thanks
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
string name="";
if(rad1.checked)
{
name = "I selected";
}
else if(rad2.checked)
{
name = "II selected";
}
else if(rad3.checked)
{
name = "III selected ";
}
else
{
name ="IV selected" ;
}
but this code use when no of radiobutton i9s less otherwise use radiobuttonlist .
|
|
|
|
|
Hi,
What is wrong with the following code?
<ul>
<% foreach (TaskList.Task task in ViewData.Model) %>
<li>
<%= task.EntryDate.ToShortDateString() %>
</li>
</ul>
It compiles fine, but when I run it then the following error displays:
foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'
Regards,
Brendan
|
|
|
|
|
Is ViewData.Model a collection of TaskList.Task objects?
var question = (_2b || !(_2b));
|
|
|
|
|
Cheat and use the asp:Repeater for lists like this it looks more ASP.NETy. As for the runtime error that is mostly caused by enumerating on a type without an enumerator. Remember, unfortunately, declarative programming turns compile time errors into run time errors.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
Hi,
When I click on the show all files button to see my code behind then it shows the bin and debug folder, but not my code behind for the aspx files. Does anybody know why this happens, or am I doing something wrong?
Thanks
Brendan
|
|
|
|
|
When I create a new MVC view page this what the top of the page lookslike:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
There is no code behind attribute. What am I doing wrong?
|
|
|
|