|
hey i have a solution!!!!!!!!
Just save the values in Temporary datatable and after that run that temporary datatable in a loop and write the insert in it.....
private void SaveGridDataInTempTable()
{
DataTable dtTemp = new DataTable();
if (dtTemp == null || dtTemp.Columns.Count <= 0)
{
dtTemp.Columns.Add("sino");
dtTemp.Columns.Add("name", typeof(String));
dtTemp.Columns.Add("gender", typeof(String));
dtTemp.Columns.Add("qualification", typeof(String));
dtTemp.PrimaryKey = new DataColumn[] { dtTemp.Columns["sino"] };
}
foreach (GridViewRow gvRow in GridView1.Rows)
{
DataRow drTemp = dtTemp.NewRow();
drTemp["sino"] = int.Parse(GridView1.DataKeys[gvRow.RowIndex]["sino"].ToString());
drTemp["name"] = ((TextBox)gvRow.FindControl("TextBox1")).Text.Trim();
drTemp["gender"] = ((RadioButtonList)gvRow.FindControl("RadioButtonList1")).SelectedValue.ToString();
drTemp["qualification"] = ((DropDownList)gvRow.FindControl("DropDownList1")).SelectedValue.ToString();
dtTemp.Rows.Add(drTemp);
}
Temp = dtTemp;
}
//Property to maintain the Datatable
public DataTable Temp
{
get
{
object o = ViewState["Temp"];
if (o == null)
{
DataTable dt = new DataTable();
return dt;
}
else
return (DataTable)o;
}
set
{
ViewState["Temp"] = value;
}
}
After this your normal insert code,
for(int i=0;i
|
|
|
|
|
Hi ,
I am developing an application with a datagrid using which user can update the data in the datagrid row. Its all in ASP.Net c#.
on click of a button i should do the following.
Check if user has modified atleast one row.
1. If the user has not modified even one row, then i should display a messsage stating user to action atleast one row.--- I have done this check and works good.
2. If the user has changed atleast one row then i should display a alert asking for confirmation if they would like to proceed. If the user selects 'No' i should stop the execution. if he clicks Yes the execution should proceed. -- I need help on this .. I am not able to trigger it becuase the button is already clicked.
Please help me sort the point 2.
|
|
|
|
|
A button click with a server control can have two events, OnClientClick and OnClick. OnClientClick will call a javascript method, which needs to return true for OnClick to be called on the server. So, make your onClientClick show a message box and return true or false, based on what the user clicks.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi Ramkithepower,
Cud u please tell me where is the button located.
with in the Datagrid or outside the datagrid on the form.
Regards,
_Anil
jhgdgf
|
|
|
|
|
i want to open another datagrid on the click button of first datagrid
|
|
|
|
|
do you want to open the datagrid in another page or ...?
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
no i want to open in the same page
|
|
|
|
|
Do you mean nested, or further down the page ? If you want to open number 2 based on what number 1 selects, then you need to use AJAX. If you want them nested, you probably need to use repeaters to lay out your controls.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
i have two columns in the datagrid and clicking on the button column of the datagrid i want to open second datagrid
|
|
|
|
|
You've restated your need, without answering any quesitons or adding any information. My answer, therefore, remains the same. You can do a postback, or you can use AJAX.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Put the nested Datagrid in a template column of the main datagrid ,
use divs to display/Hide Datagrid on click of the button
|
|
|
|
|
just put a multi view and when u click the button in a Grid send the primary key to the select query and display the view(that is your 2nd data view)
|
|
|
|
|
Dear govindi,
There are two way to put grid on the page.
First is that you can put it into the another grid (Nested grid).
and the another one is that you put seperate grid on the page.
In nested grid you hv to bind the second grid in rowdatabound event.
Let me know if u want another clearficitation.
_Anil
jhgdgf
|
|
|
|
|
Hello Everyone and thanks in advance for helping me with this.
I need to programmatically locate and change the content of Description and Keyword metatags. Searching the internet, I have found a solution (not a solid one though) but it stopped working after I have changed the order of metatags (which I can understand).
I have a masterpage site.master (with following code beside everything else as usual) where I set a default set of keywords and a default description (which are site-wide):
<head id="Head1" runat="server">
<title>My Default Page Title Here</title>
<meta http-equiv="Content-Language" content="tr"/>
<meta name="Description" content="My Default Description Here" />
<meta name="Keywords" content="these, are, my default, keywords" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254"/>
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="Rating" content="General" />
<meta name="Author" content="Haluk " />
<meta name="Copyright" content="www.acme.com.tr" />
<meta name="revisit-after" content="1" />
<meta name="robots" content="all" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="SHORTCUT ICON" href="favicon.ico" />
</head>
and there are some asp pages (linked with site.master) where I want to be able to change Description and Keywords metatags for obvious SEO reasons. I placed following C# code in respective cs files:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class akademik_indirim : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.Page.Header.Controls.RemoveAt(2);
this.Page.Header.Controls.RemoveAt(2);
HtmlMeta child = new HtmlMeta();
child.Name = "Description";
child.Content = "Custom Description for This Page";
base.Master.Page.Header.Controls.Add(child);
HtmlMeta meta2 = new HtmlMeta();
meta2.Name = "Keywords";
meta2.Content = "custom keywords, for, seo, purposes";
base.Master.Page.Header.Controls.Add(meta2);
}
}
Now this does not work. All I get is exactly the Description and Title tags I set in asp.net page PLUS SOME OLD KEYWORDS I now can’t find in my project… RemoveAt(2) does not work and additional two metatags I add in cs file are not there (in the resulting html source). This is what I get in browser source window:
<head id="ctl00_Head1">
<title>Akademik Tercüme Çeviri - Tercumex</title>
<meta http-equiv="Content-Language" content="tr" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="Rating" content="General" />
<meta name="Author" content="Haluk" />
<meta name="Copyright" content="www.acme.com.tr" />
<meta name="revisit-after" content="1" />
<meta name="robots" content="all" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="SHORTCUT ICON" href="favicon.ico" /><meta name="Description" content="This is the description I set in asp.net page" />
<meta name="Keywords" content="These are my old keywords which I removed, I searched project wide and they are not in my project anymore, but they appear in result page anyway " />
<style type="text/css">
.ctl00_NavigationMenu1_Menu1_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; }
.ctl00_NavigationMenu1_Menu1_1 { text-decoration:none; }
.ctl00_NavigationMenu1_Menu1_2 { }
.ctl00_NavigationMenu1_Menu1_3 { border-style:none; }
.ctl00_NavigationMenu1_Menu1_4 { }
.ctl00_NavigationMenu1_Menu1_5 { }
.ctl00_NavigationMenu1_Menu1_6 { border-style:none; }
.ctl00_NavigationMenu1_Menu1_7 { }
.ctl00_NavigationMenu1_Menu1_8 { }
.ctl00_NavigationMenu1_Menu1_9 { border-style:none; }
.ctl00_NavigationMenu1_Menu1_10 { }
.ctl00_NavigationMenu1_Menu1_11 { border-style:none; }
.ctl00_NavigationMenu1_Menu1_12 { }
</style>
</head>
I know that attempting to remove metatags set in site.master by this.Page.Header.Controls.RemoveAt(2) is a sloppy way to do it. But it used to work until a few days ago… And I really can’t seem to get metatags by name. Could anybody hint me to right direction here please?
I want to be able to get metatags Description and Keyword by name and change their content.
Thanks again...
|
|
|
|
|
Hi All
I am using Window.Create() method to show popup window,it' wrk fine, but the problem is some time it's lost it's innerHTLM(Message),Below are the code,we are calling this function as below
var waitID = window.setTimeout(doPopUp(msg,380,50,fontColor,backColor),3000);
function doPopUp()
{
var oPopup = window.createPopup();
var oPopBody = oPopup.document.body;
oPopup.document.oncontextmenu=returnFalse;
oPopBody.style.backgroundColor = backColor;
oPopBody.style.color = fontColor;
oPopBody.style.font="normal 12px Arial";
oPopBody.style.border = "1px solid #DAD682";
oPopup.show(screen.availHeight/2 - height/2, screen.availWidth/2 - width/2, width, height, document.body);
oPopBody.innerHTML = "<div width=100% height=6 style=background-color:#FFFFD9;display:block;> </div><div align=center valign=middle height="+height+" style= font-size:12px;COLOR:#333;border-bottom:1px solid #DAD682; border-right:1px solid #DAD682; border-left:1px solid #F5F091; border-top:1px solid #F5F091;background-color:#FFFFBE;padding-top:10>" +msg+"</div>";
return oPopup;
}
prabhakar dwivedi
|
|
|
|
|
1. Click any tab, for eg. Click general information tab.
2. Click edit button.
3. General information edit page is opened.
4. click any other tab(for eg. Official tab).
5. Again click general information tab, it displayed general information edit page. It should display the view page of the general information.
6. Once clicked the any other tab, current page should go to view status.
how to change edit mode to view mode while tab change event. Please tell me the answer
|
|
|
|
|
I'm at a loss here. You're talking about your specific site ? Sounds like you need to close your edit mode when the tab is changed ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Your question is not clear.
Either you love IT or leave IT...
|
|
|
|
|
cspriya wrote: 1. Click any tab, for eg. Click general information tab.
2. Click edit button.
3. General information edit page is opened.
4. click any other tab(for eg. Official tab).
5. Again click general information tab, it displayed general information edit page. It should display the view page of the general information.
6. Once clicked the any other tab, current page should go to view status.
Looks like Test Case
|
|
|
|
|
Set a property or View State,
public string Mode
{
get
{
object o = ViewState["Mode"];
if (o == null)
return String.Empty;
else
return (string)o;
}
set
{
ViewState["Mode"] = value;
}
}
when clicking the Edit tab give the Mode as Mode = "E"
when clicking the View tab give the Mode as Mode = "V"
Now write the code based on the mode like,
if(Mode == "E")
{
//Your code goes here....
}
if(Mode == "V")
{
//Your code goes here....
}
|
|
|
|
|
hi,
i'm using treeview in my application n i'm having a problem that when i check the treeview checkbox its status doesn't get true(checked=false).
so plesae help me in solving this problem...
plz its urgent.
|
|
|
|
|
Malik1122 wrote: plz its urgent.
Turns out, it's not urgent to me at all...
Is the viewstate turned on for the control ? Where are you checking it's status ? Are you databinding the control ? If so, where ?
So hard to answer based on the complete lack of detail you provide.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi,
Are you binding the treeview in page load? If it is then just ensure that it is written inside !IsPostBack block.
Either you love IT or leave IT...
|
|
|
|
|
Seriously. I have a fair sized app that I've been working on for quite some time. Previously it has deployed without problems. It also works just fine with the built in webserver, but fails under IIS.
However, now it won't. That is, the app deploys, but instead of working, it gives me the following error:
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Security, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I've tried everything I can come up with to fix it. I just want to deploy the freaking site so someone can look at it. It's not going into production in a secure environment right. Hell, I don't even care any more if the machine gets owned (it's a VM anyway on a crappy box anyway and is due for a reformat.). I just need to let somebody look at it, and I can't make it happen because of this problem. I'm sick, I've wasted an hour and a half out of my day trying to fix it.
If someone can identify what particular "feature" of Enterprise library, .NET, or Visual Studio is causing this problem and tell me how to make it go away, I'd really appreciate it.
I only need a quick and dirty hack to make it work. Nothing fancy. Removing all traces of Enterprise library from my system and every project I do now and in the future has just become top priority, so I don't even need a sustainable solution.
|
|
|
|
|
Well, I finally tracked it down. I was using integrated security when connecting to my database. When running under IIS, this was failing. Enterprise library was performing some mystery operation as a result of the error, the result of which was a new exception that swallowed the old one.
I still hate it and it is still poo though.
|
|
|
|