|
Ok this is annoying I have it working in vb.net but not working in c# i have gone through and made sure that it is putting the name of the text box of where the value is to go in the correct palce and it all seems to be fine, but when the user selects a date it closes the calendar but doesn't put the value in the text box.
protected void Change_Date(object sender, System.EventArgs e)
{
string strScript = "<script>window.opener.document.forms(0)." + control.Value + ".Text = '";
strScript += calDate.SelectedDate.ToString("MM/dd/yyyy");
strScript += "';self.close()";
strScript += "</" + "script>";
RegisterClientScriptBlock("anything", strScript);
}
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
are you talking about vb.net or C# ?
One Tips : while adding string use StringBuilder. this is good practice and good for membory also.
cheers,
Abhijit
|
|
|
|
|
I originally got it to work with vb.net following your original advise and a tutorial/example I found but am now wanting it in c# and it is set up the exact same way but doesn't want to put the value in the text box.
Thanks for the tip and sorry for the confusion.
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
This is the code for main Page
//This is Textbox where i have display the date from popuo
myID= "<%=txtCal.ClientID%>";
function Button1_onclick() {
//open popup page
window.open("default2.aspx","test",'left=100,top=100,width=200,height=200');
}
Code in Popup window
Server Side (code behiend)
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
string dt = Calendar1.SelectedDate.ToShortDateString();
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, "updateParent('" + dt + "');", true);
}
Client Side
function updateParent()
{
<code><b> //Tip:Accept Argument From Server Side</b></code>
var argv = updateParent.arguments;
window.opener.document.getElementById(window.opener.myID).value = argv[0];
self.close();
}
This should run perfectly. dont forget to vote
cheers,
Abhijit
|
|
|
|
|
Thank you for sticking with me on this one. After a long day at work yesterday taring my hair out. I have gone through your sloution and got it to work. Thank you.
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
This is the code for main Page
<script language="javascript" type="text/javascript">
myID= "<%=txtCal.ClientID%>";
function Button1_onclick() {
window.open("default2.aspx","test",'left=100,top=100,width=200,height=200');
}
</script>
Code in Popup window
Server Side (code behiend)
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
string dt = Calendar1.SelectedDate.ToShortDateString();
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, "updateParent('" + dt + "');", true);
}
Client Side
<script language="javascript">
function updateParent()
{
var argv = updateParent.arguments;
window.opener.document.getElementById(window.opener.myID).value = argv[0];
self.close();
}
</script>
This should run perfectly. dont forget to vote
cheers,
Abhijit
|
|
|
|
|
Hi all
How do i delete/remove a Querystring variable.
say Request.QueryString["ID"]);
i have tried this Request.QueryString["ID"].Remove(0) but it didnt remove it nor did it give an error message.
I also tried Request.QueryString.Clear(); and the error was the variable is readonly
|
|
|
|
|
you want to delete it from where? the URL??? please tell more what you mean
The Developer - CEH
|
|
|
|
|
i want ID in Request.QueryString["ID"]) to be zero so that
when i write code like this int s = Convert.ToInt32(Request.QueryString["ID"])
s will become zero, in other words i need to initilize the variable "ID" in the querystring.
|
|
|
|
|
hey i know its not good solution but i did it.
i hope dis will help u.
if (!Page.IsPostBack)
{
if (Request.QueryString["qstr"] != null) // if the query string exists
{
ClientScript.RegisterStartupScript(this.GetType(), "qr",
"document.all(\"aspnetForm\").action = \"YourPage.aspx\";",true);
RedrawPage(Request.QueryString["qstr"]);
}
}
Reasons are not Important but Results are Important.
Swati
|
|
|
|
|
QueryString collection will be populated on the page life cycle. You can't remove items from it. BTW, why do you need to remove a query string ?
|
|
|
|
|
I want to load new record on scroll.
I mean when user scroll the new records loading and previous deleted. i am using ajax for this but i dont know to load the new records
|
|
|
|
|
Which record you want to load ?
Are you using any Ajax Control for it ?
Your question is some what incomplete please elaborate the same
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
|
|
|
|
|
Please make your question be clear as Sandeep said.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
I'm having a problem with datatable after i passed it to a function using byval in the page load. Inside the function I remove some of the rows that are not needed for that function. But i noticed that the original datatable rows in the page load was also deleted.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ds as New datatable
Dim data as New datatable
'This part loads the data from the database using oracledatareader with a name "reader"
'Total datatable rows = 50
data.load(reader)
ds.Tables.Add(CreateOverall(data))
'Call the next function and pass the same datatable.
'Total datatable rows became 40
'Is byVal not working???
ds.Tables.Add(CreateDetails(data))
End Sub
Public Shared Function CreateOverall(ByVal record As DataTable) As DataTable
'I remove 10 rows in this functions
for i as integer = 0 to record.rows.count-1
record.Rows.RemoveAt(i)
next
return record.
End Function
Public Shared Function CreateDetails(ByVal record As DataTable) As DataTable
'Received 40 rows only
End Function
Anyone knows how to retain the original values in page load?
Thanks.
Hans
|
|
|
|
|
ByVal works perfectly - it is you who isn't...
You pass a DataTable to a function, manipulate it, then pass it back - and are surprised to see your changes? What did you expect? If you don't want to see changes, pass it to a Sub (Procedure) instead of a funxtion. (Or simply pass back True or something instead of the DataTable)
|
|
|
|
|
Hi all
How i write the event handler for linkbutton for calling Data from database inside formview .
i want to display record detail into formview using linkbutton click . how i do that?
iam creating linkbutton programmatically using linkbutton class how i set the properties there?
any help or article is highly appericated
Thanks in advance
Regards
Rameez
|
|
|
|
|
linkbuttonname.EventName+=new EventHandler
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Thanks for reply
please write in little about how i write event handler for linkbutton click to display record from database into formview control.
Any Article or link is highly apperciated
i know i have to use data binding but how ? give me hint please.
Regards
Rameez
|
|
|
|
|
Hello
In a website the result of students can be accessed only by their respective ID numbers! there is no other way to access the database. like the website shows a textbox with a submit button and the textbox only accepts a number i.e. the ID of student.
I want to grab all the result that is a way in which ID starting from 1 to 8000 are put in the textbox in a LOOP and data retrieved is SAVED in some file(a text or database file)...
so is there any way?
|
|
|
|
|
Please be concise about your question. After reading again and again i am unable to get your point.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
http://www.etea.edu.pk/uet.asp[^]
check this out! you will see the textbox and the submit button! I need to get to all the result! i dunno may there or some other simple ways but what i am thinking is if we start submitting numbers from 1 to say 10000 and store the data we get in a file? is it possible? or if there is any simple way to get all the result?
|
|
|
|
|
I might be wrong, but it looks like you are trying to get data from that site without their knowledge. We don't entertain such kind of practices here.
|
|
|
|
|
its not some illegal stuff!
i just said if there is some other way and didn't mean like someone hack their database!
I gave my idea like to do iteration! just like if someone sits and start giving ID himself, submitting it and getting the info and thn saving it by himself,,,, there should be a way to do it in programming or scripting! which ll be fast....
|
|
|
|
|
I have a .net web project where we use Crystal report(which comes along with VS 2005) for few of the reports. It works fine in the localhost, but when run in the server it throws the following error
Also i have an XML file which will be read by an dataset and this dataset will be provided as datasource to the report.
Error:
Type 'http://schemas.microsoft.com/sqlserver/2004/sqltypes:varchar' is not declared, or is not a simple type.
Stack Trace:
[XmlSchemaException: Type 'http://schemas.microsoft.com/sqlserver/2004/sqltypes:varchar' is not declared, or is not a simple type.]
System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e) +1081039
System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) +67
System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe) +2134
System.Xml.Schema.Compiler.Compile() +823
System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo) +17
System.Xml.Schema.XmlSchemaSet.Compile() +292
System.Data.DataSet.ReadXSDSchema(XmlReader reader, Boolean denyResolving) +301
System.Data.XmlDataLoader.ProcessXsdSchema() +144
System.Data.XmlDataLoader.LoadData(XmlReader reader) +1657577
System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving) +900
System.Data.DataSet.ReadXml(String fileName) +62
Reports_CrystalPage.Page_Load(Object sender, EventArgs e) +239
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
Any help would be of great use.
N.Surendra Prasad
|
|
|
|