<asp:BoundField DataField="CreatedOn" DataFormatString="{0:M/dd/yyyy}" HeaderText="Created On" /><asp:BoundField DataField="ExpiresOn" DataFormatString="{0:M/dd/yyyy}" HeaderText="Expires On" />
Blog
SVN: TortoiseSVN Can’t Move .. The file or directory is corrupted andunreadable (Windows 7)
TortoiseSVN
Can’t move
‘..\..\.svn\entries’ to ‘..\..\.svn\entries’:
The file or directory is corrupted and unreadable.
If you have recently upgraded to Windows 7 (in my case, ultimate 64 bit) and moved all your SVN development repositories to your sweet, new, resource friendly OS. Installed TortoiseSVN and have begun your regular routine of development you are in for a painful experience. The error above happens when you attempt to do an SVN commit containing a large number of files and causes a complete failure to commit all your work to the SVN repository no matter how many times you try.
Don’t get me wrong there are plenty of people out there who are having no problem what so ever after they upgrade to Windows 7, but there is a small number out there who are ready to beat the hell out of their computers with a sledge hammer! All because they did one little thing wrong.
The error above is caused because I turned on Windows Indexing Service and added the folder all of my SVN repositories are in to the indexing list. SVN creates a load of temp files as it prepares to commit your changes to the repository and uses a file called ‘entries’ located in the ,svn folder to hold temporary entries.
As SVN creates these temp files and updates the ‘entries’ file the Windows indexer sees that changes have been made to the file and grabs on to that file in an attempt to re-index it. Well, while the indexer is messing with the file SVN has moved on to the next file and soon thereafter is ready to alter the ‘entries’ file again. Of course the indexer has a hold of that file and will not allow SVN to access the file until it is done doing what it does. Thus the epic battle begins and the two processes begin fighting over the file. SVN is not a native Windows process and therefore loses and in its agony it screams out in desperation “Can’t Move!”.
In short Turn off Indexing of your SVN repositories by the Windows Indexing Service.
DNN: Cannot hit Page_Load event of Control
If you are developing a DotNetNuke module and are in the middle of coding and testing that module within a DNN installation and have noticed that you cannot get Visual Studio to enter the Page_Load event of your User Controls and its driving you insane!
Here is the simple solution, make sure your module definition has the Cache Time set to 0. I have found that this is most likely the reason you never see the Page_Load or any other initialization methods hit when debugging your module.
0
DNN: Navigating Within a Module
Here are several methods which can be used to navigate between controls within a DotNetNuke module.
#region Navigation Methods
///
/// Redirects to module view.
///
protected virtual void RedirectToModuleView()
{
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true);
}
///
/// Gets the module control URL.
///
/// Name of the control.
///
protected virtual string GetModuleControlUrl(Enum controlName)
{
string[] param = new string[2];
param[0] = MODULE_ID_KEY;
param[1] = ModuleId.ToString();
return DotNetNuke.Common.Globals.NavigateURL(TabId, controlName.ToString(), param);
}
///
/// Gets the module control URL.
///
/// Name of the control.
/// Name of the parameter.
/// The parameter value.
///
protected virtual string GetModuleControlUrl(Enum controlName, string parameterName, int parameterValue)
{
return GetModuleControlUrl(controlName, parameterName, parameterValue.ToString());
}
///
/// Gets the module control URL.
///
/// Name of the control.
/// Name of the parameter.
/// The parameter value.
///
protected virtual string GetModuleControlUrl(Enum controlName, string parameterName, string parameterValue)
{
string[] param = new string[4];
param[0] = MODULE_ID_KEY;
param[1] = ModuleId.ToString();
param[2] = parameterName;
param[3] = parameterValue;
return DotNetNuke.Common.Globals.NavigateURL(TabId, controlName.ToString(), param);
}
///
/// Gets the module control URL.
///
/// Name of the control.
/// The parameters.
///
protected virtual string GetModuleControlUrl(Enum controlName, string[] parameters)
{
List<string> param = new List<string>();
param.Add(MODULE_ID_KEY);
param.Add(ModuleId.ToString());
param.AddRange(parameters);
return DotNetNuke.Common.Globals.NavigateURL(TabId, controlName.ToString(), param.ToArray());
}
#endregion
SQL: Reseeding the Identity Column
If you have reference tables containing list data used to populate drop downs and selection controls in your UI, you may run into instances where you need to clear and repopulate these tables with updated data. But at the same time you may need to maintain the identity numbers when the table is repopulated to make sure that references from other tables remain correct. To accomplish this you need to make sure that your SQL scripts reset the table’s identity column back to 0 so that when the table is repopulated the first entry begins with 1 rather than 32. Here is an example:
DELETE FROM [UsState]GODBCC CHECKIDENT('UsState', RESEED, 0)GOINSERT INTO [UsState] VALUES ('Alabama', 'AL');INSERT INTO [UsState] VALUES ('Alaska', 'AK');INSERT INTO [UsState] VALUES ('Arizona', 'AZ');INSERT INTO [UsState] VALUES ('Arkansas', 'AR');
ASP.net: TabContainer Maintain Selected Tab Index with Hidden Field
JavaScript which hooks to the OnClientActiveTabChanged=”OnTabChanged” event of the TabContainer. When the event is called the currently selected tab index is pulled and saved to the hidden form field.
<script type="text/javascript">
function OnTabChanged(sender, args) {
var tabControl = $get("").control;
var currentIndex = tabControl.get_activeTabIndex();
$get("").value = currentIndex;
}
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
Hidden form filed added to ASCX or ASPX view.
<asp:HiddenField ID="hfSelectedIndex" runat="server" />
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
Method for setting the ActiveTabIndex of the TabContainer if there is a value in the hidden form field.
private void SetCurrentTab()
{
if(!string.IsNullOrEmpty(hfSelectedIndex.Value))
{
int value;
if (int.TryParse(hfSelectedIndex.Value, out value))
tcStoreEditor.ActiveTabIndex = value;
}
}
Call the SetCurrentTab method in the Page_Load event to set the selected index if one exists.
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//Some Method Calls Here
}
SetCurrentTab();
}
