|
Any details, plz?
I need the simplest way for implementing this thing . Thanks
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
You don't need AJAX at all, although you could use it. Just set a timer using one of the many javascript timer code examples that exist on the web. Set the users starting time on the server, and always use that to reset the timer on postback ( it's so easy to change client side script, you should never rely on it being correct ).
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am writing a WebPart for SharePoint and am having trouble re-painting a control (not ASP control) when I want to reflect some scripting action.
My class inherits from "Microsoft.SharePoint.WebPartPages.WebPart".
I found the ASP listbox control lacking because I wanted to include a checkbox, graphics as well as text for each item.
An array of checkboxes contained within a div (for scrolling) contained in a feldset (for a border to contain the entire set) made for a good display of the data with the ability to access each item individuality.
The array is rendering the way I want it with a checkbox, icon and text for each item and the scrolling is working properly.
I am able to check and un-check each individual item in the array of checkboxes but the CheckAll() and ClearAll() functions are not checking or clearing all the items in the array.
Can anyone tell me what I need to do to make the CheckAll() and ClearAll() functions work?
In "protected override void RenderContents(HtmlTextWriter writer)"
<br />
writer.Write("<fieldset style='width: 760px;'>");<br />
writer.Write("<legend><strong>" + lblDocInfo.Text + "</strong></legend>");<br />
<br />
writer.Write("<div style='overflow: auto; height: 145px;'>");<br />
<br />
foreach (string folder_key in current_folders)<br />
{<br />
writer.Write("<input type=checkbox name='" + folder_key + "' id='" + folder_key + "'><img src='http://sharepointservername/projectname/websitename/icons/folder.ico' align='middle'> " + folder_key.Substring(folder_key.LastIndexOf("/") + 1) + "</input><br />");<br />
}
<br />
foreach (string doc_key in current_docs)<br />
{<br />
writer.Write("<input type=checkbox name='" + doc_key + "' id='" + doc_key + "'><img src='http://sharepointservername/projectname/websitename/icons/doc.ico' align='middle'> " + doc_key.Substring(doc_key.LastIndexOf("/") + 1) + "</input><br />");<br />
}
<br />
writer.Write("</div>");
<br />
writer.Write("</fieldset>");<br />
<br />
writer.Write("<br /><br />");<br />
writer.Write("<input id='btnCheckAll' type='button' value='Check All Documents' onclick='CheckAll();' style='width: 380px;' />");<br />
writer.Write("<input id='btnClearAll'type='button' value='Clear All Checked Documents' onclick='ClearAll();' style='width: 380px;' />");<br />
writer.Write("<br />");<br />
btnProcess.RenderControl(writer);<br />
writer.Write("<br /><br />");<br />
and further down in the code
<br />
writer.Write("<script type='text/javascript'>");<br />
<br />
writer.Write("function CheckAll(){");<br />
foreach (string doc_key in current_docs)<br />
{<br />
writer.Write("document.getElementById(doc_key).checked = true;");<br />
}
writer.Write("document.getElementById('btnClearAll').disabled = false;");<br />
writer.Write("}");
<br />
writer.Write("function ClearAll(){");<br />
foreach (string doc_key in current_docs)<br />
{<br />
writer.Write("document.getElementById(doc_key).checked = false;");<br />
}
writer.Write("document.getElementById('btnClearAll').disabled = true;");<br />
writer.Write("}");
<br />
writer.Write("</script>");<br />
|
|
|
|
|
What does it mean ?
How does it occur ?
and what should I do ?
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Tnx
|
|
|
|
|
razi_Seyyedi wrote: This error can be caused by a virtual directory not being configured as an application in IIS.
There you go. I suggest you read the article I link to in my sig, especially the bit on researching error messages.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It means that you have an application level section in a web.config file that is not in the root folder of your web.
Either you have put an illegal section in a web.config file in a folder in your application, or what you think is the root folder of your application is just a folder in another application.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
... instead of creating Resource files for each language.
Is it possible?
---
Harsh Gupta
|
|
|
|
|
Are you Sonia's brother ?
What do you mean by 'dynamic' ? Creating resources for each language is the best way I can think of to create resources so you can change the language of your site, if you wanted it to happen via some translation algorithm or something, that could only end in tears.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi,,
on my project asp.net with c#
I added a javascript item for eg,, name : JS.js
and made the next function :
function PopUpQtyWindow(id)<br />
{<br />
window.open("productqty.aspx?id=" + id, "Cart", "status = 1, height = 150, width = 200, resizable = 0"); <br />
}
then on any page i tried to call this function as next :
<br />
int prodID = 1 ;<br />
HyperTest.NavigateUrl = "javascript:PopUpQtyWindow(" + prodID + ");";
when running project and press the hyperTest .. status message " Error on page " .
thanks for all .
jooooo
|
|
|
|
|
1. What error message you get?
2. Do you have configuration like down below?
<br />
.<br />
.<br />
.<br />
<script type="text/javascript" src="JS.js"><br />
</script><br />
.<br />
.<br />
.<br />
I Love T-SQL
|
|
|
|
|
thanks for your reply my friend
the error message is appear on the status bar of the internet explorer :
Error on page,
that is the error message ,, no debug
jooooo
|
|
|
|
|
You can click on that error message to show you details, so you can see what the error is. Either the function is not present, or it's got an error in it.
I would recommend installing firefox and the firebug add on, then you can debug your javascript inside the browser.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I will install it and try ,,
thanks my friend
jooooo
|
|
|
|
|
Hi,
Test this way:
<br />
protected void HyperTest_OnClick(object sender, EventArgs e)<br />
{<br />
try<br />
{<br />
int prodID = 1 ;<br />
Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "PopUpQtyWindow(" + prodID + ");", true);<br />
}<br />
catch (Exception ex)<br />
{ <br />
throw;<br />
}<br />
}<br />
|
|
|
|
|
Really thanks for your reply ..
on my example the code as next :
HyperTest.NavigateUrl= ....
when i use the code :
HyperTest.NavigateUrl= Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "PopUpQtyWindow(" + prodID + ");", true);
then error message:
Cannot implicitly convert type 'void' to 'string'
thanks for aiding me
jooooo
|
|
|
|
|
No no, HyperTest.NavigateUrl is wrong.
Say, I test your code in this way:
<br />
<script type="text/javascript" language="javascript"><br />
function PopUpQtyWindow(prodID)<br />
{<br />
alert(prodID);<br />
}<br />
</script><br />
<asp:linkbutton id="HyperTest" runat="server" onclick="testClick" text="Test"></asp:linkbutton><br />
And in behind:
<br />
protected void testClick(object sender, EventArgs e)<br />
{<br />
int prodID = 1;<br />
Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "PopUpQtyWindow(" + prodID + ");", true);<br />
}<br />
This code is working on both IE and firefox browsers.
|
|
|
|
|
|
I have a DetailsView in which I have a DropDownList in the EditItemTemplate.
I need to access the list and populate it when the Edit command is clicked on the DetailsView.
I tried the following:
<br />
protected void dvStation_ModeChanged(object sender, EventArgs e)<br />
{<br />
DetailsViewRow row = dvStation.Rows[0];<br />
DropDownList ddlStatus = (DropDownList)row.FindControl("ddlStatus");<br />
ddlStatus.DataSource = dsStatus;<br />
ddlStatus.DataTextField = "STATUS_NAME";<br />
ddlStatus.DataBind();<br />
}<br />
But its not populating my list. I also tried a SqlDataReader, did the connection and SQL, then used a while loop to populate like:
<br />
cmd = new SqlCommand(sql, conn);<br />
dr = cmd.ExecuteReader();<br />
while (dr.Read() != null)<br />
{<br />
ddlStatus.Items.Add(dr.GetString(0));<br />
}<br />
That didn't do it either...
Any ideas?
Thanks.
Ekjon
|
|
|
|
|
Do it in the prerender event of the detailsview
Ask if currentmode is editmode
If so, get the ddl and bind it
Inside the prerender event
If Me.detailsview.CurrentMode = detailsviewmode.Edit Then
''Get ddl and bind it
End If
Alexei Rodriguez
|
|
|
|
|
Hi Alex,
It worked fine, thanks.
Now, the list is populated but I want to select the item that is the current status. So, in the same prerender - I opened the connection, got the data and tried to select it.
Didn't work.
Then I tried the same thing in ItemCommand event (Occurs when a button within a DetailsView is clicked), didn't work either.
Any idea on this?
Thanks again.
Ekjon
|
|
|
|
|
It should work
Once you get the dropdownlist in the prerenderevent (Edit mode)
populate the ddl and cal DATABIND
then: dropdownlist.selectedvalue = yourvalue
It looks like all you need is to allow the user to select a value from a dropdownlist when in edit mode, and obviously, when the record enters in edit mode, show the previously selected value
If so, you can do all this automatically
Just add the ddl to the edit template (Like you already have i think), you can also set its datasource to a sqldatasource
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind ("TestColumn") %>'>
</asp:DropDownList>
</EditItemTemplate>
Alexei Rodriguez
|
|
|
|
|
In my Project i have to add drop down selected item to datagrid on add button,nearly 10 items i have to add,so i have taken an shared datatable
and added row to that and assigned it to datagrid.
meanwhile when two users are working on the same .aspx page ,during postback the second user is getting the items added by the first user
Help me Regarding this....
|
|
|
|
|
Member 4567541 wrote: shared datatable
static in C# right ? A static member will be available to all the threads in the application domain. So all the users will get the same instance of DataTable . If you need to keep user specific data, keep it in session variables.
|
|
|
|
|
Yeah, he asked this twice, the first time, he was less clear, but I answered him the same, he voted me 1 and deleted his post. Man, that's annoying.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Man, that's annoying.
Yes, it's annoying. We take effort to help people and they will go without telling anything or leaving a "1" vote. It's really annoying. There are lot of people in IT industry who don't have any idea about the basics and working with big projects ! These might be the reasons why outsourcing sucks. You know big Indian companies like Wipro,infosys are taking more people and most of them are sitting idle or waiting for a project. Most of them won't be suited for this job, and they look only for huge salary, not job satisfaction or interest.
BTW, are you doing any outsourcing to India ? If yes, is that going well ? I am just wondering.
|
|
|
|