|
Thanks for the solution. can u pls help me to find solution regarding with my Datagrid. I'm new to c#. in my coding i'm using control DataGrid named dgUserNote.
in its update command , i'm not getting the values in the cells
when i take e.Item.Cells[2].Text it shows like;
e.Item.Cells[2].Text=""
the code is as follows;
in designing part(asp) i add the Column as follows;
<columns> <asp:editcommandcolumn canceltext="Cancel" edittext="Edit" headertext="Edit" xmlns:asp="#unknown">
UpdateText="Update">
in coding (c#) i wrote like this;
void dgUserNote_UpdateCommand(object source, DataGridCommandEventArgs e)
{
SqlCommand SqlCom;
if (ConGlobal.State == ConnectionState.Closed) ConGlobal.Open();
SqlCom = new SqlCommand("SpInsertUserNote", ConGlobal);
SqlCom.Parameters.Add("@IorU", SqlDbType.VarChar).SqlValue = "U";
SqlCom.Parameters.Add("@Title", SqlDbType.VarChar).SqlValue = e.Item.Cells[2].Text;
SqlCom.Parameters.Add("@Description", SqlDbType.VarChar).SqlValue = e.Item.Cells[3].Text;
SqlCom.Parameters.Add("@Date", SqlDbType.VarChar).SqlValue = e.Item.Cells[4].Text;
SqlCom.Parameters.Add("@UserName", SqlDbType.VarChar).SqlValue = mdlNewClass.gStrUserName;
SqlCom.CommandType = CommandType.StoredProcedure;
SqlCom.ExecuteNonQuery();
SqlCom = null;
Response.Write("Record Updated Successfully...");
BindData();
dgUserNote.EditItemIndex = -1;
dgUserNote.DataBind();
}
pls help me to solve this problem
Thanks&Regards
Princy
|
|
|
|
|
On my Default.aspx page I have an iframe. The iframe has a button and does some calculation. But once the calculation is done I want to pass those values to a panel that is on my Default.aspx.
For instance
Default.aspx
------------------------------------
| |
| iframe |
| |-------------------------- |
| | Button | |
| | | |
| |-------------------------- |
| |
| Panel |
|___________________________________|
Is this even possible please help? Thanks
|
|
|
|
|
|
I am trying to create a server control library that includes an AJAX component from the AJAX toolkit. I have added the controls to the class and I am either
a) getting an exception thrown when I add the extender to the controls collection. This is the
Extender controls may not be registered after PreRender.
Error.
or b) not getting an exception but the control does not render to the page.
This is the code:
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
pExtender.Page = this.Page;
ScriptManager.GetCurrent(this.Page).RegisterExtenderControl<collapsiblepanelextender>(pExtender, pnContent);
EnsureChildControls();
}
protected override void RenderContents(HtmlTextWriter output)
{
try
{
//render panel to page
pExtender.Page = this.Page;
//set extender panel options
pExtender.ExpandedText = ExpandedTitle;
pExtender.CollapsedText = CollapsedTitle;
pExtender.ID = "cpe";
pExtender.TargetControlID = "pnContent";
pExtender.ExpandControlID = "pnTitle";
pExtender.CollapseControlID = "pnTitle";
pExtender.Collapsed = InitialCollapsedState;
pExtender.TextLabelID = "lblTitle";
pExtender.ImageControlID = "imgpanel";
pExtender.SuppressPostBack = false;
//set the id for the two content panels
pnContent.ID = "pnContent";
pnTitle.ID = "pnTitle";
//add the label panel to the control
pnTitle.Controls.Add(TheHeader);
//add the form to the panel
pnContent.Controls.Add(theForm);
//render title panel
//this.Controls.Add(pnTitle);
//render content panel
//this.Controls.Add(pnContent);
//pnSurroundingPanel.RenderControl(output);
this.Controls.Add(pExtender);
//pExtender.RenderControl(output);
//this.Controls.Add(pnSurroundingPanel);
//pnSurroundingPanel.RenderControl(output);
pnTitle.RenderControl(output);
pnContent.RenderControl(output);
}
catch (Exception ex)
{
DiagnosticMessage.reportError(ex);
}
}
If I comment out the line that is causing the exception, this.Controls.Add(pExtender); and replace it with pExtender.RenderControl(output); the exception is not shown but the page is blank and the control has not been rendered to the page.
Does anyone know how to get the ajax control to render properly to the page. I have seen several posts regarding this and have tried a few things but nothing has worked yet.
Any help is much appreciated as tis one has been driving me mental!
Notes:
TheHeader is a usercontrol for the header or closed state of the control and the TheForm is the usercontrol that is the content of the open panel.
Thanks
Simon
|
|
|
|
|
Hi
I quite new here and I have a question:
I have built page in VS2008 using c# & the following debug error:
CS1061: 'ASP.ds2_aspx' does not contain a definition for 'btnSubmit_Click' and no extension method 'btnSubmit_Click' accepting a first argument of type 'ASP.ds2_aspx' could be found (are you missing a using directive or an assembly reference?)
Line 50: <tr>
Line 51: <td class="main" style="width: 135px"> </td>
Line 52: <td class="main" style="width: 278px"><input type="Submit" id="btnSubmit" OnServerClick="btnSubmit_Click" value="Send" runat="server" onclick="return btnSubmit_onclick()" /></td>
Line 53: </tr>
Line 54: </table>
and I would appreciate any suggestions
|
|
|
|
|
Your code behind class is missing the btnSubmit_click method you defined in OnServerClick.
Add a method to your cs file:
public void btnSubmit_Click(object sender, EventArgs e) {
...
}
|
|
|
|
|
And it would probably be a good idea to use an ASP button rather than an HTML button.
|
|
|
|
|
In my C:/WIDOWS/TEMP folder on my web server, the list of temporary files are too much. Can it affact the overall performance of my web server.
I delete it manually every morning when I start the server .
What Should I do?
Ashish Jha
Software Engineer
|
|
|
|
|
You should probably try to find out what is creating the temp files.
|
|
|
|
|
I created a scheduled task that runs on Saturdays that cleans up various folders on my server. These files are created as part of some report generation and web application logs.
I would also recommend that after cleaning up these files, you may also consider defragmenting the drive. Creating and deleting files can have a negative impact on server performance due to the fragmentation that is created on the drive.
|
|
|
|
|
Hi,
If I close the browser window, session_end doesn't get fired.
I want to do some updations in database when the user tries to close the window wiithout cliking on 'Logout' button provided.
Any solution for this problem?
|
|
|
|
|
If you close the browser, the session end will automatically called when it reached to the time out.
if you want to explicitly doing something on browser close, just detect the browser close during using javascript and open some small popup which will clear the database data from server side code then close the popup also.
if you find the code project asp.net forum you will find lots of similar question and answer.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Thank u. Can u give some links to refer for the solution?
|
|
|
|
|
Its not good to get client events by using the javascript.
Another way is to write the code in the Session_End event similar event is there (I forgot )
there you can have you logic what you want to do whenever user session has been end.
One question
1. Do you need to do update the DB no sooner user closed the window ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Sandeep Akhare wrote: Its not good to get client events by using the javascript.
Then how will you trap the browser close event ?
if you want to detect browser close you have to use javascript.
Sandeep Akhare wrote: Another way is to write the code in the Session_End event similar event is there (I forgot D'Oh! )
there you can have you logic what you want to do whenever user session has been end.
if you use Session.Abandon(), it will directly moved to Session_End() event in your Global.asax file, and inside that methods you can write your logic that what ever you want to implement.
Sandeep Akhare wrote: One question
1. Do you need to do update the DB no sooner user closed the window ?
As per my understanding, he is storing some user information while user log into the system. and he is removing those in the log off. But, the problem happens when user close the browser. If user close the browser, Session_end() will only call when its time out.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Abhijit Jana wrote: As per my understanding, he is storing some user information while user log into the system. and he is removing those in the log off. But, the problem happens when user close the browser. If user close the browser, Session_end() will only call when its time out.
That should fine and this make sure that every time Session_End gets called
1. Please tell me what happens when system crashed or browser crashed for a perticular user...
2. depending on the client browser is not idle way as there can be many scenario there javascript may get failed.
that's why i asked him is it necessary to update the DB no sonner user closed the browser?
I think log information he can update when session_end gets called?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Karthick_gc wrote: Thank u. Can u give some links to refer for the solution?
You can try this one,
function DeleteUserLog()
{
if(window.event.clientX < 0 && window.event.clientY <0)
{
window.open("CloseSession.aspx", "OpenWindow_Close_Session",'left=12000,top=1200,width=10,height=1');
}
}
Call this method on unload of your master Body .
onunload="DeleteUserLog()"
Now in CloseSession.aspx pages, you can do what ever you want and register the client script to close it automatically after doing the task.
Hope this will helps you.
BTW : I am planning for writing an article on same. Hope this will be published soon.
Cheers!!
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
How to retrive attribute Name
<br />
<names><br />
<firstname fn="*"></firstname><br />
<zipcode zc="*"></zipcode><br />
<rule rl="%LEIN"></rule><br />
</names><br />
Here the thing is in some Names tag the attribute of Rule is RL or RLL.
<br />
<br />
<rule rl="%LEIN"></rule><br />
<rule rll="%LEIN"></rule><br />
<br />
I am getting error at bold line below. Bcz, i mentioned direcly RLL. If RL exists as attirbute then getting error. how to get attribute name?
XmlNodeList NameList = doc.GetElementsByTagName("Names");
foreach (XmlNode node in NameList)
{
XmlElement nameElement = (XmlElement)node;
foreach (XmlNode xnode in nameElement)
{
XmlElement childElement = (XmlElement)xnode;
if (childElement.Name.ToLower() == "rule")
{
if (childElement.HasAttributes)
strrule = childElement.Attributes["RLL"].InnerText.ToLower();
}
}
}
G. Satish
|
|
|
|
|
if (childElements.Attributes["RLL"] != null)
{
//Get that value
}
else
{
//Get other value.
}
|
|
|
|
|
Dear All
can anybody please tell me how can i call Oracle Report using C# Asp.Net?
what peace of code would required?
Regards,
MF
|
|
|
|
|
I haven't used a recent version of Oracle Reports, but according to their faq:
How do I integrate Oracle Reports into my application?
If your application is Web- or J2EE-based, either embed the URL to call your Web-deployed reports within your application or use Oracle Reports Web Services. If you are using Oracle Forms, use the built-in RUN_REPORT_OBJECT procedure to communicate with the Reports Server. In order to integrate reports into your application on the database level, you can use the event-based reporting API to submit jobs to Oracle Reports Services from the database by calling this PL/SQL-API.
So, I guess it depends on what you mean by "call". If you just want to bring up a report, it looks like you can point to the report URL. There doesn't seem to any real api, especially .NET based.
Scott
|
|
|
|
|
hi,
thanks for your answer. i just ask that.
WHAT PEACE OF CODE WOULD I USE TO CALL ORACLE REPORT THROUGH C# ASP.NET?
what line of code required?
Regards,
MF
modified on Sunday, April 26, 2009 11:54 PM
|
|
|
|
|
|
hi,
this link is not working....
whenever i click it post me at Google search...
please send me full link.
Regards,
MF
|
|
|
|
|
Hi all,
How can I convert a HTML file to .Doc file in C#.net? Currently i am using ghtmldoc.exe with arguments "--webpage -f " + DocFile + " " + html file". However the conversion is successful but the resulting Doc file is missing images in it. Can somebody help me out or knows some other workaround to convert HTML to DOC.
Happy Coding,
Vivek Rathore
|
|
|
|